in reply to Re^2: Filling in missing values in an array
in thread Filling in missing values in an array
Though I'm not quite sure how tests 3-5 are supposed to goNeither was I! So I made it die (a.k.a throws an exception) when the array consists only of NULLs. Garbage in, garbage out, as we used to say. Exceptions prevent the garbage leaking out.
If you decide it should do something other than die, just change this line:
die "No values found" if @arr && 0 == grep $_ ne '_', @arr;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Filling in missing values in an array
by Neighbour (Friar) on Jun 30, 2011 at 06:39 UTC | |
by FunkyMonk (Chancellor) on Jun 30, 2011 at 10:07 UTC | |
by Neighbour (Friar) on Jul 04, 2011 at 11:17 UTC |
In Section
Seekers of Perl Wisdom