Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Re: "bareword found near www" in oneliner

by Anneq (Vicar)
on Feb 09, 2004 at 00:24 UTC ( #327521=note: print w/replies, xml ) Need Help??

in reply to Re: "bareword found near www" in oneliner
in thread "bareword found near www" in oneliner

Windows supports double AND single quotes.
perl -MURI::Escape -MLWP::Simple -e"$t =get ' +encrypt_index.htm\'; print uri_unescape $t;"

Replies are listed 'Best First'.
Re: Re: Re: "bareword found near www" in oneliner
by borisz (Canon) on Feb 09, 2004 at 09:50 UTC
    Sure, windows supports qouble and single quotes inside a perl script. But I was talking about quoting mechanisms of your shell ( cmd.exe ). Sorry if this was not obvious.
      I actually tested use of single quotes inside of double quotes at my shell prompt before sending the previous message. The OP did, after all, state that he was having problems with the command prompt.

      Windows does indeed support single quotes AND double quotes at the command prompt, invoking perl with the "-e" option.

        I think you completely misunderstand "support" here. Windows's cmd.exe "supports" single quotes, just like it supports a, b, 3, 7, 9, and =. They are just ordinary characters. A double quote has an entirely different kind of support. It will allow having spaces or other special characters as part of a command argument instead of their normal interpretation (where a space, for instance, would mean a break between arguments) and doesn't itself become part of the argument.

        C:\windows\system32>c:/perl/bin/perl -we'print "Hello World\n"' Can't find string terminator "'" anywhere before EOF at -e line 1.
        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:
        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:
        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.
        If you think cmd.exe does something special with single quotes, show an example.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://327521]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2023-12-10 11:36 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (39 votes). Check out past polls.