This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re:perl and cygwin
- To: cygwin at sources dot redhat dot com
- Subject: Re:perl and cygwin
- From: Jorge Goncalvez <goncal11 at col dot bsf dot alcatel dot fr>
- Date: Mon, 9 Jul 2001 17:15:05 +0200 (MEST)
- Reply-To: Jorge Goncalvez <goncal11 at col dot bsf dot alcatel dot fr>
Hi , I have made a perl program but When i start it I have the following error:
Can't locate Sys/Syslog.pm in @INC (@INC contains: D:/Perl/li
.) at renifleur.pl line 7.
Why, Syslog.pm exits althougt.
#SNIPPET 17:1388
#!/usr/bin/perl -w
# renifleur - journalise les tentatives de connexion sur des ports
# particuliers
use Sys::Syslog;
use Socket;
# identifie mon port et mon adresse
$nom_socket = getsockname(STDIN)
or die "je n'ai pu m'identifier : $!\n";
($port, $adr_ip) = sockaddr_in($nom_socket);
$mon_adresse = inet_ntoa($adr_ip);
# trouve un nom pour le service
$service = (getservbyport ($port, "tcp"))[0] || $port;
# et identifie maintenant l'adresse distante
$nom_socket = getpeername(STDIN)
or die "je n'ai pu identifier l'autre extrémité : $!\n";
($port, $adr_ip) = sockaddr_in($nom_socket);
$son_adresse = inet_ntoa($adr_ip);
# et journalise l'information
openlog("renifleur", "ndelay", "daemon");
syslog("notice", "Connection from %s to %s:%s\n", $son_adresse,
$mon_adresse, $service);
closelog();
exit;
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/