* Grant McLean <[EMAIL PROTECTED]> [2005-06-13 00:30]:
> You can use both, by taking advantage of Perl closures for the
> 'loop' index and the fact that if the routine you schedule with
> Timeout->add returns TRUE, it will be rescheduled:
>
> my $i = 1;
> Glib::Timeout->add(100,
> sub {
> return FALSE if $i > 100;
> # do stuff here
> $i++;
> return TRUE
> }
> );
Or maybe a little cleaner,
sub {
# do stuff here
$i++;
return $i > 100;
}
Regards,
--
#Aristotle
*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;
_______________________________________________
gtk-perl-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list