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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Closure warning with Perl 5.14?
by BrowserUk (Patriarch) on May 19, 2011 at 08:36 UTC | |
by BerntB (Deacon) on May 19, 2011 at 08:45 UTC | |
by moritz (Cardinal) on May 19, 2011 at 10:24 UTC | |
by BerntB (Deacon) on May 19, 2011 at 11:11 UTC | |
by BrowserUk (Patriarch) on May 19, 2011 at 08:51 UTC | |
by BerntB (Deacon) on May 19, 2011 at 08:56 UTC | |
by BrowserUk (Patriarch) on May 19, 2011 at 09:03 UTC | |
by JavaFan (Canon) on May 19, 2011 at 09:11 UTC | |
by tye (Sage) on May 19, 2011 at 17:02 UTC | |
by BerntB (Deacon) on May 19, 2011 at 09:19 UTC | |
by JavaFan (Canon) on May 19, 2011 at 09:45 UTC | |
| |
|
Re: Closure warning with Perl 5.14?
by wind (Priest) on May 19, 2011 at 08:44 UTC | |
by BerntB (Deacon) on May 19, 2011 at 08:51 UTC | |
by toolic (Bishop) on May 19, 2011 at 12:33 UTC | |
by anonymized user 468275 (Curate) on May 19, 2011 at 11:35 UTC | |
|
Re: Closure warning with Perl 5.14?
by ikegami (Patriarch) on May 19, 2011 at 09:50 UTC |