Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Vow Triptych

by jwkrahn (Abbot)
on Dec 30, 2008 at 17:14 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 23:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found