This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re:perl and cygwin


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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]