if ( $connected) { print " Port $port is up.\n"; } else { print " Port $port is down.\n"; }