in reply to Re: Re: Passing Array of Arrays
in thread Passing Array of Arrays
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Passing Array of Arrays
by broquaint (Abbot) on Mar 11, 2003 at 13:57 UTC | |
|
(z) Re^4: Passing Array of Arrays
by zigdon (Deacon) on Mar 11, 2003 at 13:53 UTC |