in reply to Re^3: my $scope as the default for variables
in thread Please help me print this hash.
Yes, but turning a single use of a lexical variable into a warning will raise warnings for code like:
use Guard; sub foo { $guard = scope_guard { print "done\n" }; ... do stuff, without ever mentioning $guard again ... };
This could maybe circumvented by only raising the warning when my is missing:
use Guard; sub foo { # This will warn $guard = scope_guard { print "done\n" }; ... do stuff, without ever mentioning $guard again ... };
Detecting this will be tricky, but it should catch most of the typos that would get a warning.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: my $scope as the default for variables
by Anonymous Monk on Jun 19, 2012 at 09:12 UTC |