Front page | perl.beginners |
Postings from March 2002
Help on debugging
Thread Previous
|
Thread Next
From:
Jeff Moore
Date:
March 18, 2002 07:31
Subject:
Help on debugging
Message ID:
5.1.0.14.2.20020318101451.00a06cf0@ccmgate.sunyjefferson.edu
Hi all
Recently, I was handed the job of converting all our perl from an AIX 4.2
box to our Linux 6.2. Never having worked with perl, I have run into a
problem that I can't seem to solve.
The perl below cancels on the line
"/usr/netscape/server4/extras/flexanlg/flexanlg -n $server -m $lognames -c
huk -t u5h5 -l c15h15 -r -p ctl 2>&1 >> $rf;" with these results.
Bareword found where operator expected at /webdata/perl/jcc_monthly line
38, nea
r "/usr/netscape"
(Missing operator before netscape?)
syntax error at /webdata/perl/jcc_monthly line 38, near "/usr/netscape"
Unrecognized file test: -n at /webdata/perl/jcc_monthly line 38.
I have run the line from a command line by inserting the values that
$server and $lognames should be and it runs fine. So, I put in a print to
see what value that $logname has. Nothing prints. Not even the '*'.
Any ideas??
=============================================================
# !/usr/bin/
# !Monthly Access log reporting!
chdir "/usr/netscape/server4/bin/https/lib" or die "Can't cd to
/usr/netscape/server4/bin/https/lib!\n";
$WORKDIR=`/webdata/perl/workarea`;
$LOGDIR=`/usr/netscape/server4/https-jcc/logs`;
$server=`jcc`;
$tf=$WORKDIR/tf$$;
$rf=$WORKDIR/rf$$;
$lf=$WORKDIR/lf$$;
# !find last month
$month = (localtime(time()))[4]+1;
if ($month == 1) { $monthl = `Jan`; }
if ($month == 2) { $monthl = `Feb`; }
if ($month == 3) { $monthl = `Mar`; }
if ($month == 4) { $monthl = `Apr`; }
if ($month == 5) { $monthl = `May`; }
if ($month == 6) { $monthl = `Jun`; }
if ($month == 7) { $monthl = `Jul`; }
if ($month == 8) { $monthl = `Aug`; }
if ($month == 9) { $monthl = `Sep`; }
if ($month == 10) { $monthl = `Oct`; }
if ($month == 11) { $monthl = `Nov`; }
if ($month == 12) { $monthl = `Dec`; }
$lognames=`find $LOGDIR -name "access.$monthl*" -exec echo "-i" {} "\c" \;`;
# all data
print '*' . $lognames;
print "ALL data">$rf;
/usr/netscape/server4/extras/flexanlg/flexanlg -n $server -m $lognames -c
huk -t u5h5 -l c15h15 -r -p ctl 2>&1 >> $rf;
# just html files accessed by off campus users
print "\n\n\n\nOff campus access, no 204 or 192 IP numbers">>$rf;
find $LOGDIR -name "access.$monthl*" -print |
while read fn;
do
grep -v "^136" $fn > $tf;
grep -v "^192" $tf>> $lf;
done
/usr/netscape/server4/extras/flexanlg/flexanlg -n $server -i -m $lf -c huk
-t u5h5 -l c15h15 -r -p ctl 2>&1 >> $rf;
Thread Previous
|
Thread Next