in reply to Compiler Optimization
O=Deparse only deparses and doesn't actually compile the code, right?
The first sentence B::Deparse's description (emphasis mine):
B::Deparse is a backend module for the Perl compiler that generates perl source code, based on the internal compiled structure that perl itself creates after parsing a program.
But what does the compiler do?
Try it out:
$ perl -MO=Deparse -e 'if($var||2) {print "foo"} else {print "bar"}' if ($var or 2) { print 'foo'; } else { print 'bar'; } -e syntax OK $ perl -MO=Deparse -e 'if(2) {print "foo"} else {print "bar"}' do { print 'foo' }; -e syntax OK
In the second example you see the code being compiled away.
|
|---|