in reply to Closure warning with Perl 5.14?
Remove the if after the declaration of $color. It serves no purpose and is leading to the error:
If you were ever to need initialize a variable conditionally, be sure to use the ternary operatormy $color = shift;
my $variable = $condition ? 'value' : undef;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Closure warning with Perl 5.14?
by BerntB (Deacon) on May 19, 2011 at 08:51 UTC | |
by toolic (Bishop) on May 19, 2011 at 12:33 UTC | |
Re^2: Closure warning with Perl 5.14?
by anonymized user 468275 (Curate) on May 19, 2011 at 11:35 UTC |
In Section
Seekers of Perl Wisdom