Hi , I wanted to parse the last line of a file c:\cygwin_syslog.txt and if it
begins with : tftpd i want to draw a progress bar which is growing from 0 to
100, in a GUI.
My code is:
open SYSLOG,"<c:/cygwin_syslog.txt" || die "can't open: $!";
while (<SYSLOG>)
{
chomp;
if (/^tftpd/)
{
use Test;
plan tests => 15;
my $var = 0;
my $pb = $mw->ProgressBar(-bd => 3, -relief =>
'raised', -fg => 'blue', -variable => \$var)->pack;
ok(defined($pb),1,"Cannot create");
ok(defined(tied($var)),1,"Variable not tied");
ok($pb->cget('-from'),0,"Bad from");
ok($pb->cget('-to'),100,"Bad to");
for my $v (map(10*$_+3,1..10))
{
$var = $v;
ok($pb->cget('-value'),$v,"Value not $v");
$mw->update;
sleep 1;
}
ok(defined(tied($var)),'',"Variable still
tied");
}
}
I ve got 2 problems with this code:
First even the last line of my file doesn't begin with tftp the progress bar
begin to grow .
When the progress bar has reached 100 it kills all my Gui.
Why?
Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- PARSING A FILE Pedro A Reche Gallardo
- Re: PARSING A FILE Chas Owens
- RE: PARSING A FILE Wagner-David
- Re: Parsing a file Jorge Goncalvez
- Re: Parsing a file Sascha Kersken
- Re: Parsing a file Sascha Kersken
- Parsing a File Jorge Goncalvez
- Parsing a File Kevin der Kinderen
- Parsing a file Morrison, Trevor (Trevor)
- Re: Parsing a file John W. Krahn
- parsing a file Stephen Finley
- Re: parsing a file WC -Sx- Jones
