in reply to (tye)Re: Calling subroutine in a package from other perl sub.
in thread Calling subroutine in a package from other perl sub.
Yes. This is a good explanation of the diferences between shift and accessing @_ directly. After I shift, the alias is gone from @_. So its obvious I cant modify the original value.
However, things dont exactly work like this though. And an alias is not the same as a reference. Correct? Because if test($x,$y,$z) does @_ = (\$x, \$y, \$z) then in then in the code you would have to dereference the variable after you shift them to access them. They would be references not scalar data. my $x = shift @_; print $$x;
zzSPECTREz
NOTE: I appreciate your responses. You allways get me thinking.
|
---|
Replies are listed 'Best First'. | |
---|---|
(tye)Re2: Calling subroutine in a package from other perl sub.
by tye (Sage) on Jan 17, 2001 at 22:19 UTC |