in reply to Re^2: RFC: Idiom for named read-write arguments (aliases) instead of using $_[0] etc
in thread RFC: Idiom for named read-write arguments (aliases) instead of using $_[0] etc
Looking again, I see you are right. Whilst related, they are not the same usage.
By way of penance:
sub swap{ our($a,$b); local( *a, *b ) = \( @_ ); ($a, $b ) = ( $b, $a ) } my( $x, $y ) = ( 1, 'fred' ); swap( $x, $y ); print "$x, $y";; fred, 1 print swap( 1, 'fred' );; fred 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: RFC: Idiom for named read-write arguments (aliases) instead of using $_[0] etc
by LanX (Saint) on Sep 02, 2012 at 20:47 UTC | |
by BrowserUk (Patriarch) on Sep 02, 2012 at 21:03 UTC |