A
arne
Hi
below is my rather short script that just takes STDIN and logs it to syslog
if I attach this program to apache as my access-log (I know why i do it like
this), after a few days, the process mem-size is 132Meg and above, which is
too big for such a small program.
have i done something wrong? Should I use references somewhere?
*cut*
#!/usr/bin/perl
use strict;
#this is a funny construction, could have said <1 or > 2
if (@ARGV != 1 && @ARGV != 2) {
print "usage: $0 <servicename> <prefix>\n";
exit(1);
}
my $prefix="";
if (@ARGV==2) {
$prefix = $ARGV[1].": ";
}
use Unix::Syslog qwmacros :subs);
openlog($ARGV[0], LOG_PID, LOG_LOCAL2);
while (<STDIN>) {
syslog(LOG_INFO, $prefix.$_);
}
closelog();
*cut*
below is my rather short script that just takes STDIN and logs it to syslog
if I attach this program to apache as my access-log (I know why i do it like
this), after a few days, the process mem-size is 132Meg and above, which is
too big for such a small program.
have i done something wrong? Should I use references somewhere?
*cut*
#!/usr/bin/perl
use strict;
#this is a funny construction, could have said <1 or > 2
if (@ARGV != 1 && @ARGV != 2) {
print "usage: $0 <servicename> <prefix>\n";
exit(1);
}
my $prefix="";
if (@ARGV==2) {
$prefix = $ARGV[1].": ";
}
use Unix::Syslog qwmacros :subs);
openlog($ARGV[0], LOG_PID, LOG_LOCAL2);
while (<STDIN>) {
syslog(LOG_INFO, $prefix.$_);
}
closelog();
*cut*