Perl adding array with another array -
i cam across code below online it's trying add 2 array. can explain calculating 14?
my @a = (1,2,5)+(8,9); print "@a"; output: 14
output 14 $a[0]
14 => 5+9
+
operator imposes scalar context on both lists last elements taken , added,
# in scalar context $x assigned last element $x = (1,2,5); print "\$x $x\n";
outputs $x 5
warnings
pragma complain, giving hint fishy going on,
useless use of constant (8) in void context
Comments
Post a Comment