in reply to char. VS char.

YAHP - Yet Another Hash post -- character by character is safer than multiple swaps over the same string.

#!/usr/bin/perl my $text = "ABCCBAABCCBA"; my $hash = { A => 'W', B => 'R', C => 'T', }; $text2 = join "", map { $hash->{$_} } split //, $text; print "[$text]\n"; print "[$text2]\n";


my @a=qw(random brilliant braindead); print $a[rand(@a)];