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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -