Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: List::Util - Bug in first?

by ikegami (Pope)
on Feb 18, 2008 at 16:22 UTC ( #668593=note: print w/ replies, xml ) Need Help??


in reply to List::Util - Bug in first?

tye raised some good points as to why it shouldn't be done, and you haven't brought up any reason why it should be done. I once tried to come up with a situation where your proposed fix actually mattered, and didn't come up with anything. If you were looking for undef, you'd want to know more, such as the index at which the undef was found. If so, you'd use

my $idx = first { !defined($a[$_]) || ... } 0..$#a;


Comment on Re: List::Util - Bug in first?
Download Code
Re^2: List::Util - Bug in first?
by strat (Canon) on Feb 19, 2008 at 07:30 UTC

    Thank you for your replies. Now I understand that it makes more sense that it is behaving like it is.

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2014-12-18 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (44 votes), past polls