What mistake am I making in this code (Perl)? -


use strict; use warnings;  %hash = ("no1"=>1,          "no2"=>2,         );  @array = %hash;  print @array; #output: no11no22 print "\n"; $string = print @array;  print $string; #output: no11no221 

why $string not same @array? why getting 1 @ end? mistake making?

the main problem print doesn't return string, rather prints out string filehandle (see perldoc -f print). instead, can let my $string=join('',@array);


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -