$ cat text_ob.pl #!/usr/bin/perl -w use strict; my $randChar = sub () { return chr(int(rand(26)) + 65); }; while () { #s/(\w)/(??{$randChar->()}/g; s/(\w)/$randChar/g; print $_; } __DATA__ ABCDEFG $ ./text_ob.pl CODE(0x1014078c)CODE(0x1014078c)CODE(0x1014078c)CODE(0x1014078c)CODE(0x1014078c)CODE(0x1014078c)CODE(0x1014078c) #### HJAxQPv