From: Xavier Noria Date: 2007-09-30T02:39:11+09:00 Subject: Re: a different type of reference (shocked) On Sep 29, 2007, at 4:59 PM, Robert Dober wrote: > You are however wrong IMHO when looking at the problem from the > callees side, there is only one parameter which is @_. You have > accessed it in your example and when assigning to it the assignment is > not propagated to the actual parameters, that is clearly *not* call > by reference behavior. > or is my knowledge outdated maybe (I have learnt that 25years ago). Note that's your own interpretation, which does not coincide with the semantics of Perl. In Perl @_ is not an argument, it is the mean by which a function receives its arguments (versus named parameters). That's the role of @_. Since in Perl the arguments are the elements of @_, the fact that assigning to $_[0] changes the value in the caller's shows Perl is pass-by-reference. I explained a bit what happens under the hood to depict aliases are actually passed through the stack. But to justify pass-by-reference (eg in the Camel Book) you don't refer to the implementation, you assert it does because of the way it works, because of the semantics. -- fxn