Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I would like some help with the following issue. I have code with creates a new object (object->new) and wish to use it a sub. This works fine with the passing of the object as reference. However, when I want to pass the object to another function, I fail to get the reference across correctly. What am I doing wrong?
main... $object->new; func1($object); func2($object); sub func1 (\$) { my $object=shift; $object->doSomething; } sub func2 (\$) { my $object=shift; $object->doSomethingElse; func1 ($object); }
Probably the call fo func1 in func2 has the variable added incorrectly, but I'm unable to find the solution for this. I can't believe this isn't possible in perl, so I must be at fault.
BTW awaiting the email for activating my account T_I I'm posting this anonymously.
|
|---|