ok, here it is:
#!/usr/bin/perl -w
use Tk;
sub grab;
sub st;
my $me = MainWindow->new;
$menubar = $me -> Frame() -> pack('-side' => 'top','-fill' => 'x');
$filemenu = $menubar -> Menubutton('-text' =>'file') -> pack('-side' =
+>
'left');
$filemenu -> command(
-label => 'help',
-command => sub{st;}
);
$filemenu->separator();
$filemenu->command('-label'=>'exit','-command'=>sub {exit});
$me->Button(-text => 'translate to 1337',
-command => sub{grab;}
)->pack;
$text1 = $me->Text (-font=>'14','-width'=>40, '-height'=> 1
)->pack;
$me->Label(-text=> '1337 5p34k'
)->pack;
$text2 = $me->Text (-font=>'14','-width'=>40, '-height'=> 1
)->pack;
MainLoop;
sub grab
{
my $take = $text1->get('1.0','end');
$take =~ s/you/joo/ig;
$take =~ s/\b(own)/pwn/ig;
$take =~ s/good/leet/ig;
$take =~ s/great/leet/ig;
$take =~ s/cool/dope/ig;
$take =~ s/kill/frag/ig;
$take =~ s/hack/hax/ig;
$take =~ s/ing/xoring/ig;
$take =~ s/stupid/nub/ig;
$take =~ s/dumb/nub/ig;
$take =~ s/soo+/uber/ig;
$take =~ s/very/uber/ig;
$take =~ s/beginner/nub/ig;
$take =~ s/fear/phear/ig;
$take =~ tr/aA/4/;
$take =~ tr/oO/0/;
$take =~ tr/Ee/3/;
$take =~ tr/lL/1/;
$take =~ tr/tT/7/;
$take =~ tr/sS/5/;
$take =~ tr/zZ/2/;
$text2->delete('1.0','end');
$text2->insert('1.0',"$take");
}
sub st
{
my $me2=MainWindow->new;
$me2->Label(-text=>'Created By: Narmak',
-font=>'20')->pack;
$me2->Label(-text=>'1337 5p34k Visual Version 1.0',
-font=>'20')->pack;
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|