NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Eh? (Score:2)
For my results, I used ruby 1.6.7 and perl 5.8.0 on Mandrake 9. I took the sample text you gave in your journal entry and copied it over and over until I ended up with a 2.4 MB file. I used "bzip-0.21" as the target. Hopefully, I didn't screw up the logic.
I've provided the exact b
Re:Eh? (Score:1)
Or use List::Util::first instead of grep (though it may only be an improvement on bigger arrays).
I'm using perl 5.6.1 and ruby 1.6.8 and getting ruby about twice as slow as perl.
Re:Eh? (Score:2)
Re:Eh? (Score:1)
I just installed Ruby today, and have been poking through online docs earlier, and couldn't find a 'break' or 'last' statement. Is there such a thing? The best I could come up with was throwing an exception and catching it outside that loop. I still need to get a Ruby book...
Reply to This
Parent
Re:Eh? (Score:2)
Visit rubycentral [rubycentral.com] or ruby-doc [ruby-doc.org].
The first link is an online version of Programming Ruby, aka "The Pickaxe". You can still buy that book at the store, if you prefer paper.
Re:Eh? (Score:1)
I was poking through the bookstore and the only Ruby book there was Sam's "Learn Ruby in 21 days". I can't recommend it, as it had no mention of 'break', 'next', or 'redo', nor the IO.foreach method in your example (and it was a thick book).