@a = qw(Object boolean byte char short int float long double String); %p = qw( boolean Boolean byte Byte char Character short Short int Integer float Float long Long double Double ); for $a (@a) { for $b (@a) { next if $a eq $b; $c = ""; if ($a eq 'Object' && $p{$b}) { $c = "(($p{$b})x).${b}Value()"; } elsif ($p{$a} && $b eq 'Object') { $c = "new $p{$a}(x)"; } elsif ($a eq 'String' && $p{$b}) { $c = "$p{$b}.parse\u$b(x)"; } elsif ($p{$a} && $b eq 'String') { $c = "$p{$a}.toString(x)"; } print "$a\t$b\t$c\n"; } }