#!/usr/bin/perl -p BEGIN { srand(time() ^ ($$ + ($$ << 15))) } sub randcase { rand(100) < 20 ? "\u$1" : "\l$1" } s/([a-z])/randcase($1)/gie;