in reply to eval and return values
Your code wouldn't return anything since $foo is lexically re-declared in the assignment within the eval block (something that strictures would have warned you about).
I think you probably meant something like...
my $foo = eval { bar->something() }; die $@ if $@; $foo;
Update:
s/with/within/
A user level that continues to overstate my experience :-))
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: eval and return values
by AnomalousMonk (Archbishop) on Jan 14, 2009 at 20:16 UTC |
In Section
Seekers of Perl Wisdom