I don't get warnings from other closures.
It is because the declaration of $color is conditional.
my $color = shift if @_;
If you only pass 1 parameter to the outer sub, $color will never be declared, so won't (can't) be available to the inner sub.
If you just dropped the conditional, the code would work properly. If you shift a value from an empty array into a scalar it will be set to undef which will work fine in the inner sub conditional.
In reply to Re: Closure warning with Perl 5.14?
by BrowserUk
in thread Closure warning with Perl 5.14?
by BerntB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |