Well ... if you really need to know the number of the immediately following eval (why?) ... this will do it:
$_++ for my ($counter) = do {eval 'die'; $@ =~ /eval (\d+)/};Edit: It will do it, but the style is poor ... try this:
my $counter = do {eval "die"; $@ =~ /eval (\d+)/; $1+1};
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
In reply to Re: is it possible to access eval() counter?
by Sidhekin
in thread is it possible to access eval() counter?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |