in reply to File::Tail with GUI

From what I can gather, the line "Win32::GUI::Dialog()" should be at the spot labeled 2, however, I keep getting errors. Not only does it not show any information in the windows, but it also give me an error saying "Perl Command Line Interpreter is not responding" and gives me a choice to close the program or wait for it to respond. Can anyone give me advice, explain my problem or point me in the right direction (websites or something) that can help me fix the problem?

Replies are listed 'Best First'.
Re^2: File::Tail with GUI
by Acid Amygdala (Novice) on Mar 02, 2009 at 04:51 UTC
    I took a look at the Event Viewer, and the Problem Reports and Solutions, and here is what I found:
    Description A problem caused this program to stop interacting with Windows. Problem signature Problem Event Name: AppHangB1 Application Name: perl.exe Application Version: 5.10.0.1004 Application Timestamp: 48bef0d8 Hang Signature: 6b71 Hang Type: 0 OS Version: 6.0.6000.2.0.0.768.3
    Does anyone have any ideas about why it hangs perl.exe or how to fix it? Thanks.
Re^2: File::Tail with GUI
by stinkingpig (Sexton) on Mar 03, 2009 at 05:56 UTC
    Just use Win32::GUI::MessageBox intead. Why create a full window with dialog just for an alert?
      Although a Message Box would work with File::Tail, it will not work for this because I need more than one alert up at one time.
        use warnings; use File::Tail; use Win32::GUI(); use Win32::Sound; @alert = ['a'..'z']; $i=0; $p=1; my $line; my $filename = "log3.txt"; my $file=File::Tail->new(name=>$filename); while (defined($line=$file->read)) { if($line=~ /(\s+)(\d{1,4})(\.\d{1,4}){3}(\s+)/) { &Build_Window; ++$i; ++$p; } } Win32::GUI::Dialog(); sub Build_Window { if($i==50){ $p=1; $i=0;} $datetime = localtime(); $alert[$i] = new Win32::GUI::Window(-name => "Alert", -width = +> 500, -height => 150, -pos => [$p*10, $p*10]); $font = Win32::GUI::Font -> new(-name => "Arial", -bold => 1); $alert[$i] -> AddLabel(-text => $datetime, -font => $font); $alert[$i] -> AddLabel(-text => "SNORT ALERT: MALICIOUS BEHAVI +OR DETECTED!", -font => $font, -top => 50); $alert[$i] -> AddLabel(-text => $line, -font => $font, -top => + 75); my $t1 = $alert[$i] -> AddTimer('T1', 1000); #Win32::Sound::Play("SystemExclamation"); $alert[$i] -> Show(); $alert[$i]->DoEvents(); sub T1_Timer { return -1; } sub Alert_Terminate { return 1; } }
        After reinstalling Perl, all that remains is that I cannot interact with the windows that I create. Any ideas are welcome, and thanks to those who have given me advice and ideas already, you are greatly appreciated.