http://www.perlmonks.org?node_id=905630

BerntB has asked for the wisdom of the Perl Monks concerning the following question:

I ran some tests on Perl 5.14, which works well on 5.12.2.

I got this warning on a closure: Variable "$color" is not available at /.../FindingsParser.pm line 1763.

The code isn't pretty, but it doesn't do anything too abnormal.

sub make_csv_format { my $me = shift; my $color = shift if @_; my $quote_item = sub { # ... # Remove ugly kludge with prefixed color information: $item =~ s/^#[\dA-F]{6}//i unless $color; # ... }; # <------ This is line with warning. my $quote_row = sub { my $items = shift; return join(",", map { $quote_item->($_) } @$items) . "\n"; }; # ... }

This might theoretically be Perl 5.14 (or the perlbrew install?) -- with a problem when one closure calls another, or something. But to be realistic, it is me. :-) I don't get warnings from other closures.