Rob Dixon wrote:

> Joseph wrote:
> >
> > Just remember that the enclosing double-quotes are always a part
> > of Windows long filenames.  When the the sytem processes the
> > string expression offered as an argument, it takes only the
> > textual content, and strips the quuotes.  Enclose the whole
> > string, including double-quotes, in single quotes.  If you have
> > to do variable intepolation, into the filename, use the dot
> > conactenation operator instead of implicit conactenation.  Keep
> > the quote characters at the beginining and end of the string in
> > its entirelty, though.
>
> I'm not sure what you mean here Joseph. Code like
>
>   my $config = q|"C:\config.sys"|;
>   open my $fh, $config or die $!;
>
> simply doesn't work.
>
> Rob

That is correct.  It is sort of funky, too.  Here, I'll go check....
...actually, it's not funky at all.  It's magic, in the Perl open
function.  Since open does such a nice job of dealing with filenames
in whatever system you use, it handles any escaping needed to feed the
system.

Greetings! E:\d_drive\perlStuff>perl -w
 my $config = 'C:\Program Files\desktop.ini';
  my $fh;
  open $fh, $config or die $!;
  print while <$fh>;
^Z
[ExtShellFolderViews]
...
[.ShellClassInfo]
ConfirmFileOp=0

Therefore it sees any extraneous quoting as an error.  In other cases
without such magic, though, my solution is called for:  In cases
without such magic, though, my solution works:

Greetings! E:\d_drive\perlStuff>perl -w
 my $config = '"C:\Program Files\desktop.ini"';
 system 'type ' . $config;
^Z
[ExtShellFolderViews]
Default={59...
...
ConfirmFileOp=0

The system likes those double quotes for filenames containing spaces.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to