use Net::Ping; # Global variables my $timeout = 90; # Time to wait for a response from ping # Part of sub -- printf "DB Server to be tested for accessibility: $dbSrvrBox\n\n"; # Ensure the connection to the DB Server is available if (!$dbSrvrBox) { printf ("Cannot find a boxname value in \"$_\" - Will abend.\n\n"); # 2 }; next if (!$dbSrvrBox); printf "Ready to ping $dbSrvrBox\n\n"; if (ping($dbSrvrBox, $timeout)) { printf "DB Server ($dbSrvrBox) is accessible at startup.\n\n"; &msgLog ("DB Server ($dbSrvrBox) is accessible at startup.\n"); } else { printf ("Cannot access $dbSrvrBox - abending.\n\n"); # 3 }; printf "After ping\n"; RESULTS (DOS Cmd window) -- DBSERVER0: \\PLYSDEV03\DEV03- DB Server to be tested for accessibility: PLYSDEV03 Ready to ping PLYSDEV03 C:\A_DRS_Proj\PerlCoding> STAND-ALONE PING -- C:\A_DRS_Proj\PerlCoding>ping PLYSDEV03 Pinging PLYSDEV03 [ ip ] with 32 bytes of data: Reply from [ ip ]: bytes=32 time=180ms TTL=125 Reply from [ ip ]: bytes=32 time=160ms TTL=125 Reply from [ ip ]: bytes=32 time=160ms TTL=125 Reply from [ ip ]: bytes=32 time=170ms TTL=125 Ping statistics for [ ip ]: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 160ms, Maximum = 180ms, Average = 167ms C:\A_DRS_Proj\PerlCoding>