[vox-tech] quoting question in perl

Micah Cowan vox-tech@lists.lugod.org
Fri, 21 Dec 2001 12:09:01 -0800


On Thu, Dec 20, 2001 at 06:13:25PM -0800, Rod Roark wrote:
> 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.

It's not a valid character in an identifier - unless it is the entire
identifier (i.e., "'").

>From perldata, an identifier is, "a string beginning with a letter or
underscore, and containing letters, underscores, and digits."

Of course, all the "punctuation" identifiers don't follow this rule,
but it's true in general.

-Micah