use warnings; use strict; BEGIN { (my $filename = $ARGV[0]) =~ s!::!/!g; require "$filename.pm"; $ARGV[0]->import() if $ARGV[0]->can('import'); } print read_file($0);
In this case, the intent is to run perl code.pl File::Slurp.
--Solo
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
In reply to Re: modules as variables
by Solo
in thread modules as variables
by tcf03
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |