I was always told that "complex" structures (anything other than a "simple" array or hash - and the OP is talking about an AoA) got flattened, and that its integrity wasn't necessarily preserved when it was passed into and out of a sub.
I'm quite happy to be wrong, though .. that's been a pet peeve of mine with Perl for *ages* ... *grin* ..
My thinking this (probably) comes from perlsub ..
Perl sees all arguments as one big, long, flat parameter list in @_. Like the flattened incoming parameter list, the return list is also flattened on return.
I read this as saying that if I have a crazily bizarre structure, such as an AoA or AoH or whatever, its integrity and structure will not necessarily be preserved - epecially not if it becomes a simple list of scalars.
Can anyone clarify this? I'm gonna play with some code, see what happens ..
Update: Ok, so code playing proves I'm completely wrong ... all kudos to broquaint - I've learnt something completely new today .. and got rid of a pet hate :)
-- Foxcub
A friend is someone who can see straight through you, yet still enjoy the view. (Anon)
In reply to Re: Re: Re: Passing Array of Arrays
by Tanalis
in thread Passing Array of Arrays
by marctwo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |