in reply to Re^2: Lexical $_ in given/when vs. BLOCK arguments
in thread Lexical $_ in given/when vs. BLOCK arguments
The old standby local $_; will fail with
Can't localize lexical variable $_ at junk line 13. (#1) (F) You used local on a variable name that was previously declared + as a lexical variable using "my" or "state". This is not allowed. If +you want to localize a package variable of the same name, qualify it with the package name.
I think local $_ should just work, for those who can't remember to use our $_;
At a minimum, I think the perldiag entry for this error should say to use our $_;
|
|---|