Help for this page
if ($string =~ m!(^[A-Za-z0-9]{4})$!) { $string =~ tr/[a-z]/[A-Z]/; ... } else { # do some error }
Benchmark: timing 1000000 iterations of tr, uc... tr: 10 secs ( 7.49 usr 0.00 sys = 7.49 cpu) uc: 9 secs ( 6.60 usr 0.00 sys = 6.60 cpu)