Sometimes it is handy to check to see if you’ve got connectivity through an ethernet interface, especially a wireless one. This Perl program does a ping to see if the router answers and tells HCA the results.
my $p = Net::Ping->new;
my $outfile = “perl-flags.txt”;
my $outline = “”;
open OUTPUT, “> $outfile” or die “Output file open error: $!”;
$outline = “router2conn=yes”
$outline = “router2conn=no”
print OUTPUT $outline;