Help for this page

Select Code to Download


  1. or download this
    if ( !( system("ping -q -w 1 $host > /dev/null 2>&1") ) ) {
            #do something
    ...
    else {
            #report the failure
    }
    
  2. or download this
    `ping -q -w 1 -c 1 $host`; #(void context)
  3. or download this
    my $dummy_var=`ping -q -w 1 -c 1 $host`;