while () { foreach $testchar ( keys %chartran ) { if (eval ( "$chartran{$testchar}" )) { ... write out results .... } } }