pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
Res facta quae tamen fingi potuit ([personal profile] pauamma) wrote in [site community profile] dw_dev_training2010-08-31 06:34 pm
Entry tags:

Nifty perl trick I learned about today

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;'
(go ahead and try it in your Dreamhack).
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2010-09-01 10:27 am (UTC)(link)
Oh neat.

(What is the O for? I can find -M in man perlrun, but I can't find -O)
alierak: (Default)

[personal profile] alierak 2010-09-01 01:28 pm (UTC)(link)
It's the argument to -M. "perldoc O" should do something.
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2010-09-02 05:45 am (UTC)(link)
Oh dur. So obvious now, thanks!