http://qs1969.pair.com?node_id=11123702


in reply to Re: Multi-Dimensional Arrays and Array References
in thread Multi-Dimensional Arrays and Array References

Hi choroba,

Thank you very much for your reply. If I may trouble you a bit more, I have a few more questions:

1. When should I store my data in a reference such as

my $ref = [[1, 2, 3], [4, 5, 6]];

versus an array

my @array = ([1, 2, 3], [4, 5, 6]);

What is the difference?

2. In both your first example using the reference, how come $ref->[$_] can’t be written as $ref[$_]?

Gratias tibi ago
Leudwinus