Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Save Split to Array

by Grey Fox (Chaplain)
on Aug 28, 2009 at 16:05 UTC ( #791952=note: print w/replies, xml ) Need Help??


in reply to Save Split to Array

spickles
A simpler way to do the for loop is to use the foreach.
my $str = "I'm not as think as you stoned I am"; # split into individual words on whitespace delimiter # and store in array @words my @words = split( /\s+/, $str ); foreach my $word (@words) { print "$word\n"; }
-- Grey Fox
"We are grey. We stand between the darkness and the light" B5

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2022-08-17 02:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?