Title: RE: newbie trying single liner on win95.

On Windoze, only double quotes are appropriately interpreted by
command.com/cmd.exe.  So, if you need a double quote in a one-liner,
you have to use the qq/this is a double-quoted string to perl/ and
q/this is a single quoted string to perl/ operators to quote things
for perl.  Use the real double quotes to make your one-liner a single argument
for the -e option.

-Peter

---
Peter A. Vogel
Manager, Engineering Operations
iReady Corporation
http://www.iready.com; http://www.iready.net


> -----Original Message-----
> From: Philip Newton [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 03, 2000 8:41 AM
> To: Perl-Win32-Users Mailing List
> Subject: Re: newbie trying single liner on win95.
>
>
> Andrew Bastien wrote:
> > Whether or not single quotes work depends on the command, as
> > it's the command that has to parse the argument list. 
>
> However, at least on NT (cmd.exe) double quotes appear to be
> interpreted
> either by the shell or (possibly) by Perl -- at least, if I
> pass "foo bar"
> as a command line argument to a Perl script, it counts as one
> argument,
> q[foo bar], while 'foo bar' is two arguments, q['foo] and q[bar'].
>
> Moreover, perl -e "insert script here" runs the script, while perl -e
> 'script' does one of two things -- if script contains spaces,
> you get the
> error message "Can't find string terminator "'" anywhere
> before EOF at -e
> line 1.", and if it doesn't, nothing happens (presumably, the
> script is
> interpreted literally as 'script', and executing that just
> results in a true
> value -- like a script line consisting only of
>
>    'script';
>
> ). So, basically, double quotes work to enclose an -e string,
> while single
> quotes don't.
>
> Cheers,
> Philip
>
> ---
> You are currently subscribed to perl-win32-users as:
> [EMAIL PROTECTED]
> To unsubscribe, forward this message to
>          [EMAIL PROTECTED]
> For non-automated Mailing List support, send email to 
>          [EMAIL PROTECTED]
>

Reply via email to