Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use AnyModulesHere.pm; # Shift off first arg, rest will be used by # the "real" script my $script = shift @ARGV or die "Error: must pass filename\n"; my $code; open (FILE, "< $script") or die "Error: $!\n"; $code .= $_ while (<FILE>); close (FILE); eval $code; print $@ if $@;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eval a perl script
by erikharrison (Deacon) on Apr 14, 2002 at 22:05 UTC | |
by Juerd (Abbot) on Apr 14, 2002 at 22:17 UTC | |
|
Re: eval a perl script
by Juerd (Abbot) on Apr 14, 2002 at 21:45 UTC |