in reply to capturing $@ from an eval'd require
As broquaint points out, $file will be interpolated into the string before the eval runs. To see what you're really doing, try this:eval { my $file = 'foo.pl'; require $file; };
I think you'll be surprised.my $notwhatiwant = qq{ $file = 'foo.pl'; # foo has errors in it require "$file"; }; print "<$notwhatiwant>\n"; eval $notwhatiwant; dienice("that code is busted because: $@") if $@;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: capturing $@ from an eval'd require
by blahblah (Friar) on Jun 01, 2002 at 07:12 UTC |