Great! That's an unrelated error that you would need to fix no matter which version of Perl you were using.
You're trying to capturing something, but Perl didn't capture it because it didn't think it needed too. It tries to capture the minimum amount of varaibles.
Note that
is the same astry { ... } catch { ... };
try(sub { ... }, catch(sub { ... }));
The error occurs with eval EXPR:
$ perl -wle' sub f { my $x = "abc"; sub { eval q{"[$x]"} } }; print f()->(); ' Variable "$x" is not available at (eval 1) line 1. Use of uninitialized value in print at -e line 1. []
The workaround is to make sure the sub references the lexical variables you will need in the eval EXPR:
$ perl -wle' sub f { my $x = "abc"; sub { $x if 0; eval q{"[$x]"} } }; print f()->(); ' [abc]
In reply to Re^5: panic: attempt to copy freed scalar a7b9650 to ad20598
by ikegami
in thread panic: attempt to copy freed scalar a7b9650 to ad20598
by mje
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |