Maybe you should consider using a hashtable to store the information you parse out from each line of your input, e.g.:
mtab[$ii] = { 'product' => $product, 'date' => $date, 'hour' => $hour, ... };# I am a hash(ref) stored in an array
I am pretty sure that $mtab[$i][$j][$k][$l]=$user; is not doing what you have in mind - whatever that is. Be warned that Perl arrays are not sparse so if your $i,$j,$k,$l are some large-ish number then you have just created a 4-dimensional monster in RAM.
Perl arrays are not sparse. In other words, if you have a 10,000th element, you must have the 9,999 other elements, too. They may be undefined, but they still take up memory. For this reason, $array[time( )], or any other construct that uses a very large integer as an array index, is a really bad idea. Use a hash instead. (Perl Cookbook, 2nd Edition by Nathan Torkington, Tom Christiansen)
bw, bliako
In reply to Re: Why am I getting Can't use string (<string value>) as an ARRAY ref wile "strict refs" in use
by bliako
in thread Why am I getting Can't use string (<string value>) as an ARRAY ref wile "strict refs" in use
by 5NOMAD7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |