Friends,
I want to replace all characters (
a-zA-Z ) with another randomly selected character. Here's what I have tried ...
$ cat text_ob.pl
#!/usr/bin/perl -w
use strict;
my $randChar = sub () {
return chr(int(rand(26)) + 65);
};
while (<DATA>) {
#s/(\w)/(??{$randChar->()}/g;
s/(\w)/$randChar/g;
print $_;
}
__DATA__
ABCDEFG
$ ./text_ob.pl
CODE(0x1014078c)CODE(0x1014078c)CODE(0x1014078c)CODE(0x1014078c)CODE(0
+x1014078c)CODE(0x1014078c)CODE(0x1014078c)
... this was not what I wanted :( I was hopeing for output that looked like this ...
HJAxQPv
Am I on the right track or way off?
Plankton: 1% Evil, 99% Hot Gas. |