in reply to Re^3: Ping host
in thread Ping host

I use 2>&1 to include output on stderr instead of just stdout

Though this is generally a good idea, the native Windows ping (which is the only one known to me to ever output "Please check...") appears to write to stdout. I.e., this works fine for me:

perl -le "print `ping badhost` =~ /please check/i ? 'bad':'good'"