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

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -