in reply to net::ping not working for windows hosts

if ($^O =~ /WIN32/) { Net::Ping->new("icmp"); etcetera } elsif ($^O =~ /(irix | linux | SunOS | yougettheidea) /) { Net::Ping->new("tcp", 2); etcetera }
I realize the syntax may not be correct as I rarely code perl for Windows, but the logic should be sound. Also, I'm guessing you have a limited number of unix os to deal with. A cleaner regex for the unix part is up to you.

-Logan
"What do I want? I'm an American. I want more."

Replies are listed 'Best First'.
Re: Sloppy, but simple
by AcidHawk (Vicar) on Jan 10, 2003 at 09:49 UTC

    Why not something like

    unless ($^O =~ /WIN32/) { Net::Ping->new("tcp", 2); etcetera } else { Net::Ping->new("icmp"); etcetera }
    Untested..

    -----
    Of all the things I've lost in my life, its my mind I miss the most.