August 1999 | Perl Hardware Store | Slide #13 |
Now we'll see how use constant works
sub import { my $name = shift or return; my $value = shift;
my $caller = caller; *{$caller . "::$name"} = sub () { $value }; }
Real module has error checking, list constants, etc.
Real module also loads *1,094* lines of code!
Next | Copyright © 1998 M-J. Dominus |