Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Why is "for" much slower than "while"?

by Anonymous Monk
on Jan 17, 2010 at 01:52 UTC ( #817807=note: print w/replies, xml ) Need Help??


in reply to Re: Why is "for" much slower than "while"?
in thread Why is "for" much slower than "while"?

Try
whyfor2 => sub { seek( $IN1, 0, 0 ); my %counts = (); ++$counts{$_} for ( ; defined( $_ = <$IN1> ) ; ) ; die unless keys %counts == @list; },

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://817807]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2017-11-21 16:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (305 votes). Check out past polls.

    Notices?