use strict; #try to catch as many type errors as possible #### print $a+@b; #coerce array into number #### print $a+$ref_b; #coerce reference into number #### my $d=eval %c; #coerce hash into string print "d=$d"; #amusing result #### my @e=%c;print "@e"; #hashes and arrays are different types. Oh wait... print "c=$_" for %c; #### my @t=12; #coerce number into array print @t; print 0+@t; #### print "\\4 = ".(\4->{"what???"}); #??? #### print '\\4 = ' . \$4{'what???'}; #### sub test{ return ("a",123) }; #sub returns a list my $scalar_list=test(); #coerce into scalar my @array_list=test(); #coerce into array my %hash_list=test(); #coerce into hash print "\$scalar_list=$scalar_list\n\@array_list=@array_list"; #### no warnings; my %i=$ref_a; print %i; #apparently hashes can be scalar refs... #### my (%i) = $ref_a; #### no strict; $$ref_a->[88]=7; print $$ref_a->[88]