#!/usr/bin/perl -p # randomly capitalize 23% of the letters # usage i.e. ls|./randomcap.pl s/(\w)/randcase($1)/ge; sub randcase { rand(100) < 23 ? "\u$_[0]" : "\l$_[0]" }