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

can I do this without the filehandles?? cheers ;->

Replies are listed 'Best First'.
Re: Re: Re: problems with split
by integral (Hermit) on Mar 03, 2003 at 18:28 UTC
    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