in reply to Multi dimensional arrays

Firstly my snippet:
use strict; use warnings; my @array = ("w", "h", [1, 2, "c"]); foreach (@array) { if(ref($_) eq 'ARRAY') { foreach (@{$_}) { print $_,"\t"; } print "\n"; } else { print $_,"\n"; } }
Now what I am doing is iterating over the contents of the array and testing each element using the builtin 'ref'. Now if the array element is an arrayref, I iterate over that and print the contents. This prints:
w h 1 2 c
To print the contents of the array ref - I first have to dereference it by using @{}. This is the way I do it though there are most likely other methods.

I suggest you look at Advanced Perl Programming for more details :).

HTH
SP

PS: please read Writeup Formatting Tips when you post!