in reply to s/\w/random character/g
Third, don't use integer numbers for ASCII characters -- just use the characters instead.
Check this out:
use strict; use warnings; my @CHARS = ('A'..'Z', 'a'..'z'); sub rand_char { return $CHARS[rand @CHARS]; } while (<DATA>) { s/\w/rand_char()/eg; print $_; } __DATA__ ABCDEFG
|
|---|