On Mon, Oct 28, 2002 at 04:14:56PM -0000, Peter Galbavy wrote:
> Hope you have a minute to help. I am trying to use the Event module as the
> basis for a very simplistic scheduler to do multi-host pinging etc.
> 
> I would like to schedule a heap of events and then set one callback as the
> underlying code. The onle thing I want to do is pass an IP as an argument.
> 
> Trying:
> 
> ...
> Event->timer(at         => time,
>              interval   => $result->{$row}->{timer},
>              cb         => \&ping_host,
>              data       => $result->{$row}->{config});
> 
> ...
> sub ping_host
> {
>         my $event = shift;
> 
>         print join(':', $ping->ping($event->data)) . "\n";
> 
> }
> ...
> 
> fails, as $event is of class Event::Event and ->data is unknown.
> 
> What am I reading wrong, or am I completely off base ? How should I do this
> kind of thing ?

Try $event->w->data instead of $event->data

> Thanks for your time, and for making Event available.

-- 
Victory to the Divine Mother!!         after all,
  http://sahajayoga.org                  http://why-compete.org

Reply via email to