in reply to modules as variables
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: modules as variables
by tcf03 (Deacon) on Jun 28, 2006 at 18:43 UTC |