Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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:
'print
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.

In reply to Re: Re: Re: Re: Re: "bareword found near www" in oneliner by Anomynous Monk
in thread "bareword found near www" in oneliner by coldfingertips

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2022-06-25 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (81 votes). Check out past polls.

    Notices?