use warnings; use Win32::GUI(); use Win32::Sound; while(1) { $filename="log2.txt"; open(TXT, $filename)||die("Could not open file!"); @filedata = ; close(TXT); @alert = qw(a b c); $i=0; foreach $element (@filedata) { if($element =~ /(\s+)(\d{1,4})(\.\d{1,4}){3}(\s+)/) { $datetime = localtime(); $alert[$i] = new Win32::GUI::Window(-name => 'Alert', -width => 500, -height => 200); $font = Win32::GUI::Font -> new(-name => "Arial", size => 46, -bold => 1); $alert[$i] -> AddLabel(-text => $datetime, -font => $font); $alert[$i] -> AddLabel(-text => $element, -font => $font, -top => 50); $alert[$i] -> AddButton(-name => "CloseButton", -text => "OK", -pos => [ 200, 100 ]); Win32::Sound::Play("SystemExclamation"); $alert[$i] -> Show(); Win32::GUI::Dialog(); ++$i; sub CloseButton_Click { $alert[$i] -> Hide(); } sub Alert_Terminate{ -1; } #open out, ">$filename"; } } }