Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to convert some #!/bin/sh scripts into #!/usr/bin/perl scripts, and I'm not having any luck.
I've tried following the examples in "perldoc Sys::Syslog", but for some reason they're not working. My example script (below) produces no output either to the terminal I run it in, or to /var/log/messages (which I'm watching via a 'tail -f').
OS is RH Linux 7.0, Perl is 5.6.0. Sys::Syslog version is 0.1, I think.
Sample script:
#!/usr/bin/perl -w $|++; use strict; use Sys::Syslog; # For openlog() call my $ident = 'somefunprocessname'; my $logopt = 'pid'; my $facility = 'user'; # For syslog() call my $priority = 'notice'; my $mask = ''; my $format = ''; my @args = '-ip user.notice -t somefunprocessname'; openlog($ident, $logopt, $facility); syslog($priority, 'asdfasdf'); closelog();
Any and all help is appreciated. TIA mucho...
-YendorMike
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sys::Syslog produces no output...
by danger (Priest) on Dec 18, 2001 at 11:38 UTC | |
|
Re: Sys::Syslog produces no output...
by fokat (Deacon) on Dec 18, 2001 at 18:38 UTC | |
|
Re: Sys::Syslog produces no output...
by fuzzysteve (Beadle) on Dec 18, 2001 at 18:07 UTC | |
|
porting sh scripts to perl
by boo_radley (Parson) on Dec 18, 2001 at 20:09 UTC |