You could use an array of arrays:
# open FILE while(<FILE>) { # The []'s make an anonymous array, so each element # of @lines is actually an array-ref. push @lines, [split /\|/, $_]; } print "Yep.\n" if $lines[0][0] eq 'foo'; # it will
HTH.
Upd: oops, fixed my array indexes. :-)
Upd2: damn, what was I thinking? Changed @lines = [...] to proper push.
Upd3: ARGH!!! Thanks for the eq catch, buckaduck. That's what I get when I try to rush a post... :-(
bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.
In reply to (bbfu) (AoA?) Re: how do I open each line of a text file into seperate arrays?
by bbfu
in thread how do I open each line of a text file into seperate arrays?
by husani
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |