You done that when you have my $thRef = shift #_;
Now to add to the existing array:
$thRef->{'value'} = .....;
When you return from the call and access the data either in the main or
another subroutine the data has been added.
Wags ;)
-----Original Message-----
From: Arthur Cohen [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 21, 2001 15:15
To: Active State Perl (E-mail)
Subject: RE: References & subs
: >
: >sub add2hash2 {
: > # refer to data indirectly using local (my) hash
: > my $thRef = shift @_;
: > my %th = %$thRef;
:
: You are making a *copy* of the original hash here.
This is the part that puzzles me. I understand *how* it's working but
not why.
What I'd *like* to do is simply declare a local variable to manipulate
the same hash that lives at $thRef (instead of having it populate a copy
of the original hash). Simply to make the syntax within the function a
little clearer. Is this possible? (under -w and use strict?)
--Art
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl