Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

perl on Windows 2000

by perlisfun (Sexton)
on May 10, 2002 at 14:09 UTC ( [id://165642]=perlquestion: print w/replies, xml ) Need Help??

perlisfun has asked for the wisdom of the Perl Monks concerning the following question:

It does not work when i type 'perl -e 'print "xxx\n";' on DOS console. But it works when runing 'perl t.pl' (put same code into t.pl file. Thanks for any help. Error message such as: Can't find string terminator "'" anywhere before EOF at -e line 1.

Replies are listed 'Best First'.
Re: perl on Windows 2000
by perlplexer (Hermit) on May 10, 2002 at 14:19 UTC
    On Windows you need to use " instead of '

    Windows : perl -e "print 'howdy!'"
    UNIX : perl -e 'print "howdy!"'

    --perlplexer
Re: perl on Windows 2000
by Dog and Pony (Priest) on May 10, 2002 at 15:05 UTC
    In DOS you need to exchange the single quotes with double quotes, like so:
    perl -e "print \"xxx\n\";"
    As you can see, this also means that you need to escape double quotes inside your code with backslashes if you want to use them. Or use single quotes if you don't need the interpolation.
    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://165642]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 22:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found