Dr.Ruud wrote:
Greg Matheson schreef:
A. Pagaltzis:

Write the same thing without syntactic sugar from constant.pm.
    sub C1     () { 'C1' }
Mmh. I see constant.pm does very little.

Well, it nicely sets things up for the compiler to optimize.
perl -MO=Deparse -e 'use constant PI => 3.1415; print PI'
use constant ('PI', 3.1415);
print 3.1415;
-e syntax OK

Greg's version gets optimized as well:

perl -MO=Deparse -e'sub PI () {3.1415} print PI'
sub PI () { 3.1415 }
print 3.1415;
-e syntax OK

--
Keith C. Ivey <[EMAIL PROTECTED]>
Washington, DC

Reply via email to