in reply to Case where '( shift @_ )[ 0, 0 ]' returns only one value?
All three produce aa on my Perl 5.26.1 running on my Linux Mint workstation. What version of Perl are you running yours under?
spek@scelia ~/scratch $ perl -le '@_ = qw( a b c ); print( ( shift @_ +)[ 0, 0 ] );' aa spek@scelia ~/scratch $ perl -le '@_ = qw( a b c ); @A = ( shift @_ )[ + 0, 0 ]; print @A' aa spek@scelia ~/scratch $ perl -le '@_ = qw( a b c ); @A = ( shift @_ ) +x 2; print @A' aa spek@scelia ~/scratch $ perl -v This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-li +nux
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Case where '( shift @_ )[ 0, 0 ]' returns only one value?
by Paladin (Vicar) on Jan 14, 2019 at 21:47 UTC | |
by stevieb (Canon) on Jan 14, 2019 at 21:52 UTC | |
by stevieb (Canon) on Jan 14, 2019 at 22:41 UTC | |
|
Re^2: Case where '( shift @_ )[ 0, 0 ]' returns only one value?
by rsFalse (Chaplain) on Jan 14, 2019 at 21:27 UTC | |
by stevieb (Canon) on Jan 14, 2019 at 21:35 UTC | |
by AnomalousMonk (Archbishop) on Jan 14, 2019 at 21:41 UTC | |
by stevieb (Canon) on Jan 14, 2019 at 21:49 UTC | |
by markong (Pilgrim) on Jan 14, 2019 at 22:12 UTC |