#! /usr/bin/perl -w use strict; use IO::Socket; sub syslog_ok { my $s = IO::Socket::INET->new( Timeout => 5, Proto => 'udp', PeerHost => '10.0.0.1', PeerPort => 514, ); if( $s ) { close $s; 1; } else { 0; } } print syslog_ok(), "\n";