Here is the revised version of the code, which now keeps the windows up:
$filename="log3.txt"; open(TXT, $filename)||die("Could not open file!"); @filedata = <TXT>; close TXT; close TXT; open (TXT, ">$filename"); @alert = ['a'..'z']; $i=0, $p=1; while(@filedata || !@filedata) { if($filedata[0] =~ /(\s+)(\d{1,4})(\.\d{1,4}){3}(\s+)/) { &Build_Window; } shift(@filedata); ++$i; ++$p; if(!@filedata) { open(TXT, $filename)||die("Could not open file!"); @filedata = <TXT>; close TXT; open (TXT, ">$filename"); close TXT; &Loop; } } Win32::GUI::Dialog(); sub Loop { if($filedata[0] =~ /(\s+)(\d{1,4})(\.\d{1,4}){3}(\s+)/) { &Build_Window; Win32::GUI::Dialog(); } shift(@filedata); ++$i; ++$p; if(!@filedata) { open(TXT, $filename)||die("Could not open file!"); @filedata = <TXT>; close TXT; open (TXT, ">$filename"); close TXT; &Loop; } } sub Build_Window { $datetime = localtime(); $alert[$i] = new Win32::GUI::Window(-name => "Alert", -width = +> 500, -height => 150, -pos => [$p*2, $p*2]); $font = Win32::GUI::Font -> new(-name => "Arial", size => 46, +-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 => $filedata[0], -font => $font, +-top => 75); my $t1 = $alert[$i] -> AddTimer('T1', 1000); Win32::Sound::Play("SystemExclamation"); $alert[$i] -> Show(); Win32::GUI::Dialog(); sub T1_Timer { return -1; } sub Alert_Terminate { return 1; } }
The problem I have now is that only the first set of windows (the data that was first wrote to the log file) appears. Does anyone have any thoughts on this?

In reply to Re^4: Win32 GUI Window Problem by Acid Amygdala
in thread Win32 GUI Window Problem by Acid Amygdala

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.