in reply to Building three-dimensional array using push
It looks like what you really want is a hash indexed on what you're calling $var_0. Here's some code that'll do what I think you need.
open(FILE, $theFile) or die("cannot open file : $!"); while ($line = <FILE>) { my($key,@parts) = (split (/\|/, $line))[1,7,8,9]; push @{$theTable{$key}}, [ @parts ]; } close(FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Building three-dimensional array using push
by ikegami (Patriarch) on Dec 02, 2004 at 17:12 UTC |