Doesn't the absence of an empty prototype in the assignment *$AUTOLOAD = sub { $val } mean that these are just normal (non-constant) subs, and will therefore never be inlined, and therefore, called everytime they are used?
## From Socket.pm (Fnctl.pm contains an nearly identical sub) sub AUTOLOAD { my($constname); ($constname = $AUTOLOAD) =~ s/.*:://; croak "&Socket::constant not defined" if $constname eq 'constant'; my ($error, $val) = constant($constname); if ($error) { croak $error; } *$AUTOLOAD = sub { $val }; goto &$AUTOLOAD; }
In reply to Re^3: Slow constants
by BrowserUk
in thread Slow constants
by powerman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |