perl -pi -e 's/replace this/join "", map { ("a" .. "z", "A" .. "Z", 0 .. 9)[rand(62)] } 1 .. 64/eg' example.php
Let me break it into pieces.
("a" .. "z", "A" .. "Z", 0 .. 9)
is a list containing the characters you want to use in a random string.
[rand(62)]
( rand). 62 . rand , . , Perl 5, . , , , .
map . . 1 .. 64, . , , map .
join , (, join ",", "a", "b", "c" "a,b,c"). , , (.. ).
. (- /g) "replace this" (- /e) "replace this" , ( join).