#!/usr/bin/perl srand; sub ran { return $_[( rand (scalar @_ ))] } # Allow random choices while (<>) { $data = $_; # The conversion rules. # Watch the order if you decide to add your own. # Use the e regex switch and the "ran" function with a list of possibilities # to pick a random possibility. #Phrase conversions $data =~ s/(\btoo\b|\bto\b)\b/2/gi; $data =~ s/\belite\b/ran("eleet","leet")/gie; $data =~ s/\bdude/d00d/gi; $data =~ s/\bfile/phyle/gi; $data =~ s/\byou\b\b/ran("u","you","u","u")/gie; # Make "u" way more probable $data =~ s/\bcool\b/ran("kool","kewl")/gie; $data =~ s/\bhacker/haxor/gi; #Single character conversions $data =~ s/ss^\b/ran("55","\$\$","\$\$")/gie; $data =~ s/s\b/ran("z","\$", "z")/gie; #s -word boundary to z $data =~ s/e/3/gi; $data =~ s/t/7/gi; $data =~ s/(l|i)/1/gi; $data =~ s/a/4/gi; $data =~ s/s/ran("5","\$","\$","\$")/gie; $data =~ s/b/8/gi; $data =~ s/g/9/gi; $data =~ s/o/0/gi; $data =~ s/n/ran("\/\\\/","n","n")/gie; #Huh? Convert n to /\/ $data =~ s/h/ran("h","\}\{")/gie; # h to }{ $data =~ s/k/ran("k","\|\<")/gie; $data =~ s/w/\\\/\\\//gi; # w to \/\/ print $data; }