Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Re: problems with split

by integral (Hermit)
on Mar 03, 2003 at 18:28 UTC ( #240110=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: problems with split
in thread problems with split

You have to use a filehandle to read data in from a file, but for a simple program you can get away with using a <> to load data from the files listed in @ARGV (or STDIN if no files are given) with perl automatically opening them as needed.

while (<>) { print (split /\s+/)[2], "\n"; }

--
integral, resident of freenode's #perl


Comment on Re: Re: Re: problems with split
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2015-07-06 03:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls