Quote:
> I'm trying to use eval to execute all the code contained in a separate
> file. I've tried the following:
> eval "file.pl";
> but, of course, that ends up trying to execute the string "file.pl" as
> if it were code.
> How can I make eval run the code contained in file.pl?
eval {
require "file.pl";
Quote:
};
or
open(F, "file.pl") || die;
{
local $/;
$a=<F>;
}
eval "$a";
or, if you don't really need eval...
do "file.pl";
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours *and*
"If you rush a Miracle Man, for details, see http://geeksalad.org
you get rotten Miracles." --Miracle Max, The Princess Bride