> I need the code below to execute the sub double_check($host) but I
still
> want the while loop to continue exactly what it's doing.
>
> Is this possible with Perl|?
>
> while (1) {
> $p = Net::Ping->new("icmp", 4, 2); #Ping object. Uses icmp
> protocal
> foreach $host (sort keys (%host)) {
> unless ($p->ping($host)) {
> $name = $host{$host}; #Name of the machine/host
> delete $host{$host};
> double_check($host);
> }
> }
> }
Yes. After a sub call is done, execution continues immediately
after the point where the sub call occured. Every language I
know that uses the term 'sub' uses it to mean a 'subroutine'
that does something then continues execution immedately
after the point it was called.
I note that you assign to $name but never use it. Are you using
the -w switch?
In general, if you are wondering if something works, the right
thing to do is to try it, experiment a bit, try to work out the bugs
yourself, and only post to the list if you are stuck.
hth.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]