in reply to Re: Re: Re: Re: "bareword found near www" in oneliner
in thread "bareword found near www" in oneliner
Here, perl is getting as it's first argument "-we'print". It interprets the -w and -e switches, and finds that the code supplied for -e is the beginning of a single-quoted perl string, but with no end-quote, causing the error, just as if you had a perl program file consisting of just:C:\windows\system32>c:/perl/bin/perl -we'print "Hello World\n"' Can't find string terminator "'" anywhere before EOF at -e line 1.
If you add -leBEGIN{for(@ARGV){print$_}} before the -we, you can see that the space causes what comes after to become a separate argument to perl:
If you think cmd.exe does something special with single quotes, show an example.C:\windows\system32>c:/perl/bin/perl -leBEGIN{for(@ARGV){print$_}} -we +'print "Hello World\n"' Hello World\n' Can't find string terminator "'" anywhere before EOF at -e line 2.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: "bareword found near www" in oneliner
by Anneq (Vicar) on Feb 09, 2004 at 17:10 UTC | |
by Anomynous Monk (Scribe) on Feb 09, 2004 at 18:17 UTC |