Una imagen
El codigo
Código
#!usr/bin/perl #Finder Text 0.2 #Version Tk #Coded By Doddy H use Tk; my $color_fondo = "black"; my $color_texto = "green"; #if ($^O eq 'MSWin32') { #use Win32::Console; #Win32::Console::Free(); #} my $vent = MainWindow->new( -background => $color_fondo, -foreground => $color_texto ); $vent->title("Finder Text 0.2 (C) Doddy Hackman 2012"); $vent->geometry("395x440+20+20"); $vent->resizable( 0, 0 ); $vent->Label( -text => "Directory : ", -font => "Impact1", -background => $color_fondo, -foreground => $color_texto my $dir = $vent->Entry( -width => 40, -background => $color_fondo, -foreground => $color_texto $vent->Label( -text => "String : ", -font => "Impact1", -background => $color_fondo, -foreground => $color_texto my $string = $vent->Entry( -width => 30, -background => $color_fondo, -foreground => $color_texto $vent->Button( -text => "Find", -command => \&now, -width => 11, -background => $color_fondo, -foreground => $color_texto, -activebackground => $color_texto $vent->Label( -text => "Files Found", -font => "Impact", -background => $color_fondo, -foreground => $color_texto my $listas = $vent->Listbox( -width => 50, -height => 15, -background => $color_fondo, -foreground => $color_texto $vent->Label( -text => "Status : ", -font => "Impact1", -background => $color_fondo, -foreground => $color_texto my $tatus = $vent->Entry( -width => 30, -background => $color_fondo, -foreground => $color_texto $listas->bind( "<Double-1>", [ \&loader ] ); MainLoop; sub loader { $listasx = $listas->curselection(); for my $id (@$listasx) { my $linkar = $listas->get($id); } } sub now { $listas->delete( "0.0", "end" ); goodbye( $dir->get, $string->get ); $tatus->configure( -text => " " ); } sub verificar { my ( $file, $text ) = @_; my $numero_linea = 0; my @words = <FILE>; close FILE; for my $linea (@words) { $numero_linea++; if ( $linea =~ /$text/ ) { $listas->insert( "end", $file ); } } } sub goodbye { close DIR; for (@archivos) { next if $_ eq "." or $_ eq ".."; my $fichero = $_[0] . "/" . $_; if ( -f $fichero ) { $vent->update; $tatus->configure( -text => $fichero ); verificar( $fichero, $_[1] ); } if ( -d $fichero ) { &goodbye( $fichero, $_[1] ); } } } #The End ?