[vox-tech] quoting question in perl

Rod Roark vox-tech@lists.lugod.org
Thu, 20 Dec 2001 18:13:25 -0800


On Thursday 20 December 2001 05:59 pm, Peter Jay Salzman wrote:
> begin Micah Cowan <micah@cowanbox.com>
> ...
> > Well, the direct answer to your question would be to use:
> >
> >   system("rm '$filename'");
> >
> > or something similar so that the shell sees the quoting.

I read somwehre that the single quote is a valid character in an 
identifier, so you might need something like

  system("rm '${filename}'");

to make it work, but am not sure offhand.

> cool.  i didn't know that the shell would see $filename when it's
> enclosed in single forward quotes.

With Perl doing the interpolation, the shell will just see

  rm 'a file'

Cheers,

-- Rod
   http://www.sunsetsystems.com/