in reply to Reading line and Spliting it

Whenever I read a file I read the complete file into an array so I can loop through the whole file (via the array). When I use split, someone recommended I use //, like this:
@file = <MYFILE>;
foreach $l (@file)
    {
    @colarray = split /,/, $l;
    }
The biggest file I have read this way was 500,000 lines, with no problems.
Perl 5.8.8 on Redhat Linux RHEL 5.5.56 (64-bit)

Replies are listed 'Best First'.
Re^2: Reading line and Spliting it
by GotToBTru (Prior) on Jul 17, 2014 at 13:50 UTC

    You may want to investigate Tie::File as a way to simplify processing a file as an array.

    1 Peter 4:10