in reply to doodspeak

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

Replies are listed 'Best First'.
Re: Re: doodspeak
by MrNobo1024 (Hermit) on Sep 15, 2001 at 03:37 UTC
    Here's a strict-compliant version:
    #!/usr/bin/perl use strict; 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' ); print "Enter your string and press Return\nEnter EXIT to end the progr +am\n"; while(<STDIN>) { chomp; last if $_ eq 'EXIT'; foreach my $word(keys %words) { s/$word/$words{$word}/gi; } tr/OoIiLlEeAaSsTt/00111133445577/; s/s\b/z/g; print $_, "\n"; }

    -- MrNobo1024

    s]]HrLfbfe|EbBibmv]e|s}w}ciZx^RYhL}e^print