Do you know where your variables are? | |
PerlMonks |
Re: Multidimensional arraysby choroba (Cardinal) |
on Jun 06, 2023 at 15:22 UTC ( [id://11152657]=note: print w/replies, xml ) | Need Help?? |
Why do you want to create a sparse array? You don't want to iterate over it, you want to retrieve the details for a given plan. Use a hash of hashes instead. Also, you probably don't need to repeat the "plan" and "length" in the inner hash, you already know them as they're the keys to it (unless you need to iterate over the values somewhere). Update: BTW, the syntax you used is not correct.
The correct syntax is $price[1][1]. Similarly, the syntax for the hash of hashes will be
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|