in reply to Re^2: Slow constants
in thread Slow constants
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Slow constants
by Perl Mouse (Chaplain) on Nov 02, 2005 at 17:22 UTC |