Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Vow Triptych

by jwkrahn (Monsignor)
on Dec 30, 2008 at 17:14 UTC ( #733301=note: print w/replies, xml ) Need Help??


in reply to Vow Triptych

my@wordsInOrder; while (<>) { foreach ("$_" =~ m/\w+/g) { push @wordsInOrder, lc($_); } }

Wow!   You are copying $_ to a string before binding it to a match and then iterating over a list in a loop when you could just use the list directly:

my@wordsInOrder; while (<>) { push @wordsInOrder, lc() =~ m/\w+/g; }

Replies are listed 'Best First'.
Re^2: Vow Triptych
by hashED (Novice) on Dec 30, 2008 at 17:23 UTC
    Huh, didn't know you could do that. Thanks for the edge-mication.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2022-05-18 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (70 votes). Check out past polls.

    Notices?