Una imagen del programa
El codigo
Código
#!usr/bin/perl #Ping It 0.1 #Version Tk #Coded By Doddy H use Tk; use Net::Ping; my $color_fondo = "black"; my $color_texto = "orange"; #if ( $^O eq 'MSWin32' ) { # use Win32::Console; # Win32::Console::Free(); #} my $sax = MainWindow->new( -background => $color_fondo, -foreground => $color_texto ); $sax->title("Ping It 0.1 || Coded By Doddy H"); $sax->geometry("350x130+20+20"); $sax->resizable( 0, 0 ); $sax->Label( -text => "Host : ", -font => "Impact", -background => $color_fondo, -foreground => $color_texto my $host = $sax->Entry( -width => 30, -background => $color_fondo, -foreground => $color_texto $sax->Button( -text => "Ping It", -width => 10, -command => \&pingita, -background => $color_fondo, -foreground => $color_texto, -activebackground => $color_texto my $stat = $sax->Label( -text => "Status : <None>", -font => "Impact", -background => $color_fondo, -foreground => $color_texto MainLoop; sub pingita { $clas = Net::Ping->new("icmp"); if ( $clas->ping( $host->get ) ) { $stat->configure( -text => "The host is alive" ); } else { $stat->configure( -text => "The host is offline" ); } } #The End ?