On Sun, 19 Sep 2004, Federico Lucifredi wrote:
> Hello Ben,
> I am in a hurry and I am not so sure why you are evaling in there, but
> I definitely DO wonder why you are setting the alarm after what is the
> code that I imagine you want to time out ?
Ooop! I was moving the alarm around, That was a poor example. The
question is the same, however, even moving the alarm before the code that
needs to be timed out, it doesn't time it out. You were correct in what I
was trying to eval there, it was just a frustration version of the code
where I had moved it out of the correct position.
> > Code is below:
> >
> > #!/usr/bin/perl -w
> > use IO::Socket;
> >
> > STDOUT->autoflush();
> >
> > my $test;
> >
> > $SIG{ALRM} = sub { print "$test\n"; die 'died in eval\n'; };
> >
> > eval {
> >
> > open(CMD, "/usr/local/samba/bin/rpcclient -S 172.21.173.230 -U
> > administrator\%itv -c 'eventlog system'|grep -B 2 -A 7 -i dac960nt|grep -e
> > '[0-9],[0-9],[0-9]'|");
> >
> > $test = "test.";
> > #my $total = 20;
> >
> > while (<CMD>) {
> > $test .= $_;
> > #$x++;
> > #if ($x = $total) {
> > # close(CMD);
> > #}
> > }
> >
> > print "$test";
> > alarm(10);
> > };
> >
> > --
> >
> > A single conversation with a wise man is better than ten years of study.
> >
> > _______________________________________________
> > Boston-pm mailing list
> > [EMAIL PROTECTED]
> > http://mail.pm.org/mailman/listinfo/boston-pm
> >
>
>
--
There are only 10 types of people in this world...
those who understand binary, and those who don't.
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm