in reply to passing object references into subs
Ok. Two problems.
First of all, $test is already a reference, so you don't need to pass a reference to the reference to use_hash. If, for some reason, this is what you intended, you're going to need to dereference $ref twice in use_hash. Otherwise change
touse_hash(\$test);
use_hash($test);
Secondly, assuming you've made the change above, change line 19 to:
If you haven't made the change above, you'll have to nest a dereference of $ref into this statement, like so:%{$ref->hash1}->{'two'} = 'twosdata';
%{$$ref->hash1}->{'two'} = 'twosdata';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: passing object references into subs
by ihb (Deacon) on Feb 04, 2003 at 17:30 UTC | |
|
Re: Re: passing object references into subs
by Avox (Sexton) on Feb 03, 2003 at 19:51 UTC |