Una imagen
El codigo
Código
#!usr/bin/perl #Diccionario Online 0.1 #Coded By Doddy H use Tk; use Tk::ROText; use LWP::UserAgent; use HTML::Entities; if ( $^O eq 'MSWin32' ) { use Win32::Console; Win32::Console::Free(); } my $nave = LWP::UserAgent->new; $nave->agent( "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12" ); $nave->timeout(5); my $fondo = "gray"; my $letra = "black"; my $new = MainWindow->new( -background => $fondo, -foreground => $letra ); $new->title("Diccinario Online 0.1 || By Doddy H"); $new->geometry("340x290+20+20"); $new->resizable( 0, 0 ); $new->Label( -text => "Palabra : ", -font => "Impact1", -background => $fondo, -foreground => $letra my $pal = $new->Entry( -width => 25, -background => $fondo, -foreground => $letra ) $new->Button( -text => "Buscar", -width => 7, -background => $fondo, -foreground => $letra, -activebackground => $fondo, -command => \&start $new->Label( -text => "Significado", -font => "Impact1", -background => $fondo, -foreground => $letra my $con = $new->ROText( width => 39, -height => 10, -background => $fondo, -foreground => $letra MainLoop; sub start { $new->update; $con->delete( "0.0", "end" ); my $code = toma( "http://es.thefreedictionary.com/" . $pal->get ); if ( $code =~ /<div class=runseg><b>1 <\/b> (.*?)[.:<]/ ) { my $text = decode_entities($1); $con->insert( "end", $text ); } } sub toma { } #The End ?