Hey, I have a problem that I know is possible, because I have solved it before. However, the computer died and I lost my solution, and can't work it out again :)
What I want to do is pass a couple of array references into a function
and have it modify the contents of the reference.
What I have is (copied directly from my code, hence the odd seeming
names etc):
main perl file:
$setupPotWeights->([EMAIL PROTECTED],[EMAIL PROTECTED]);
print "C: Pot Up: "[EMAIL PROTECTED]" Pot Dn: "[EMAIL PROTECTED]"\n";
the sub:
sub doRandomPotentiation {
my @potUp = @{$_[0]};
my @potDn = @{$_[1]};
...(operate on these, eg:)
push @potUp, [$layer,$src,$dst];
...
push @potDn, [$layer,$src,$dst];
...
}
because I'm only dealing with references, I would expect the stuff that
is added inside the sub to end up in @potUpWeights and @potDnWeights in
the main file, however this isn't happening. A print at the bottom of
the sub tells me the data is going in, but it appears to be a different
reference than the main file is using as the print in it tells me the
arrays are size zero. Thoughts? I know I'm missing something really
basic, but damned if I can put a finger on it.
--
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
pgp00000.pgp
Description: PGP signature
