Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Pathologically Eclectic Rubbish Lister

Re^3: Filling in missing values in an array

by FunkyMonk (Canon)
on Jun 29, 2011 at 16:37 UTC ( #911994=note: print w/ replies, xml ) Need Help??

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 go
Neither 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;

Comment on Re^3: Filling in missing values in an array
Download Code
Re^4: Filling in missing values in an array
by Neighbour (Friar) on Jun 30, 2011 at 06:39 UTC
    Yea, but when it dies, the tests are never executed (in my case). That's probably not what's supposed to happen :).
      Ah, found out where things went wrong:
      My code dies with a 'No values found' for is_deeply [fill_in_the_blanks(qw< >)], [qw< >], "( )";.
      I thought that throws_ok didn't catch the die but that wasn't the case.
      Seems our approach of the 'empty array'-situation differs :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://911994]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2014-03-17 05:38 GMT
Find Nodes?
    Voting Booth?

    Have you used a cryptocurrency?

    Results (341 votes), past polls