Now you too can be 133t! Quickly change a string into the hyper-intelligent, ultra-cool language of the h4x0r underground!
#!/usr/bin/perl -w use strict; $_ = join( ' ', @ARGV ); 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;

Replies are listed 'Best First'.
Re: doodspeak
by Jerry (Scribe) on Sep 14, 2001 at 23:48 UTC
    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

      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

Re: doodspeak
by chazzz (Pilgrim) on Sep 20, 2001 at 08:37 UTC
    Here's my version. It can be used the standard 3 perl ways: doodspeak.pl "file", cat file | doodspeak.pl and finally by using STDIN.

    #!/usr/bin/perl use strict; while (<>) { chomp; exit if($_ eq "EXIT"); 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 "$_\n"; }