Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: How do I print a quote with a perl one liner on dos?

by larryk (Friar)
on Mar 23, 2005 at 11:21 UTC ( #441740=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How do I print a quote with a perl one liner on dos?
in thread How do I print a quote with a perl one liner on dos?

when you print $whatever you don't need to print "$whatever" unless you want to print "$whatever and $something else in the same string" - that'll at least save you two backslashed double quotes.

that said, the point is that with the windows command shell the double quote is the string quoting character so in order not to have your perl -e code string stop at the next ", you have to escape it for the shell's benefit. to illustrate - escaping outside of the -e code: perl -e "print qq(@ARGV)" \"hello world\"

I guess the trick is that you use single quotes instead ;)

perl -e "$helloworld = qq('hello world'); print $helloworld"

   larryk                                          
perl -le "s,,reverse killer,e,y,rifle,lycra,,print"


Comment on Re^3: How do I print a quote with a perl one liner on dos?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-08-28 04:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (256 votes), past polls