in reply to How can I watch for an active internet connection

perl -MIO -le 'sleep 10 until IO::Socket::INET->new("www.google.com:80 +"); print "Action!"'