in reply to Re^2: Aliasing and return, how does return work?
in thread Aliasing and return, how does return work?

I'm not sure if lvaluable subs work in 5.6.1. This code works for me with Perl 5.8.4:
sub ret :lvalue { $_[0] } sub foo { &ret++; print "ARGS: <@_>\n"; } my ($x, $y) = (10, 20); foo($x, $y); __END__ ARGS: <11 20>
Make sure you aren't accidentally shifting the argument you're planning on setting before you set it.
_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re^4: Aliasing and return, how does return work?
by bsb (Priest) on Jun 30, 2004 at 06:38 UTC
    Got your results with 5.6.1, must be my sketchy understanding at fault.

    Aha, it was my testing code messing up, reassigning during the middle of the test. Thanks

    update: I may have spoken too soon...