use strict; use warnings; sub pr { print \$_[0],"\t"; # print ref of para } check(qw/ Scalar 1 /); check(qw/ Array [1,2] /); check(qw/ Hash {1,2} /); sub check { my ($_title_,$type) = @_; my $_call_ ="pr $type;"; my $code= <<"__EOC"; for (1..3) { $_call_ print "\\n\\t"; #UPDATE for (1..3) { $_call_ } print "\\n"; } __EOC print "\n--- $_title_ \n"; print $code; eval $code; }