On Tue, Mar 16, 2004 at 08:36:39PM -0500, Wiggins d'Anconia wrote:
> Because you are passing in references you want to catch them into 
> scalars, then to update the values of the references you dereference 
> them in your push, so...
> my ($potUp, $potDn) = @_;
Had tried this...

> push @$potUp, [$layer, $src, $dst];
> push @$potDn, [$layer, $src, $dst];
...but not in conjunction with this. That makes all the difference, 
thanks!

> However I am curious if this is really doing what you want, as this adds 
> a new anonymous array reference to the original array rather than adding 
> the three values onto the end of the array, so you may need to switch 
> the square brackets to parentheses, or drop the grouping completely.
No, what I have is what I wanted. It is adding a triplet to the array, 
making a 2D array.

> Of course there is the whole notion of updating the external version of 
> the variable from within the sub in this manner, but I trust you know 
> what you are doing, and that you got $layer, $src, and $dst from 
> acceptable sources....
Yes, it offends my programming sensibilities a little too, however this
function is coming from a configuration file (because I need dozens of
slightly different functions, they are auto-generated by another
program), and so it is 'safe' for it to modify the arrays directly. 
There is the potential for them to get large and I wouldn't want to
create new ones, copy existing items, etc as it risks slowing my program 
down significantly for virtually no gain. (To get a feel for the 
trickyness of this, the program requires some form of programability in 
its configuration system, so Perl just 'do's the file, loading up 
appropriate variables with values)

> HTH,
It helps good, thanks :)

-- 
Robin <[EMAIL PROTECTED]>                 JabberID: <[EMAIL PROTECTED]>

Hostes alienigeni me abduxerunt. Qui annus est?

PGP Key 0x776DB663 Fingerprint=DD10 5C62 1E29 A385 9866 0853 CD38 E07A 776D B663

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to