pauamma: Cartooney crab holding drink (Default)
[personal profile] pauamma
Context was someone asking why
print "Hello, world!\n" && die;
doesn't output anything. Someone replied with a nifty trick to help figure this out:
perl -MO=Deparse -e 'print "Hello, world!\n" && die;'
or
perl -MO=Deparse,-p -e 'print "Hello, world!\n" && die;'
(go ahead and try it).

Note: -p won't make a difference here, but it helps if you suspect perl's notion of operator priorities is different from yours.

(crossposted from http://dw-dev-training.dreamwidth.org/23661.html at pne's suggestion)

Profile

command_liners: A command line prompt with a blinking cursor after it, green against black. (Default)
Command Liners

September 2014

S M T W T F S
 123456
78910111213
1415 1617181920
21222324252627
282930    

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 20th, 2017 09:55 pm
Powered by Dreamwidth Studios