Here's an idea, since the util has a tough time with long text strings:
Change it to accept it's input on STDIN, accept a line of input, convert and print, then loop around and ask for another line, unless the line = exit
or something similar. Just a thought...
UPDATE:
A bit after I made this post, I became bored and decided
to put my ideas into action. Disclaimer: Not strict, not warn. I was having problems with using a my variable in the while statement. Anyhow, here it is:
#!/usr/bin/perl
#use strict;
print "Enter your string and press Return\nEnter EXIT to end the progr
+am\n";
while ($var ne "EXIT") {
$_ = <STDIN>;
chomp;
$var = $_;
my %words = (
'you' => 'joo',
'yay' => 'woot',
'rock' => 'roxor',
'rocked' => 'roxored',
'defeated' => 'roxored',
'beat' => 'roxored',
'hacked' => 'haxored',
'!' => '!!!',
'hacker' => 'haxor',
'sucked' => 'suxored',
'suck' => 'suxor',
'elite' => 'leet',
'dude' => 'dood'
);
foreach my $word ( keys %words ) {
s/$word/$words{$word}/ig;
}
tr/OoIiLlEeAa/0011113344/;
s/s\b/$1z/g;
print if($var ne "EXIT");
print "\n";
}
Somebody come along and make it strict now, I did as much as I know how to do :)
-Jerry
http://www.digilliance.net
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.