Utiliser le module IO::Socket :
#!/usr/local/bin/perl use strict; use IO::Socket; my $remote_host = "127.0.0.1"; my $remote_port = 25; if(IO::Socket::INET->new( PeerAddr => $remote_host, PeerPort => $remote_port, Proto => "tcp", Type => SOCK_STREAM)) { print "Daemon OK\n"; } else { warn "Daemon NOK $!\n"; }