Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How do you place words from a sentence into an array?

by JediWizard (Deacon)
on Oct 26, 2004 at 15:55 UTC ( #402661=note: print w/replies, xml ) Need Help??


in reply to How do you place words from a sentence into an array?

So you want to iterate through each word in a file doing some processing on it? Try this:

open(my $fh, "< bingo_in.txt") || die "Couldn't read file: $!\n"; while(<$fh>){ foreach my $word (split){ #process word } }
May the Force be with you

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2022-05-29 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?