I don't quite know where to begin... Was the AIX box running ancient version of perl? I'm not surprised this won't compile. There's already been one response, so I'll try to stick to what hasn't been said, implementing the changes mentioned in the previous mail.
> # !/usr/bin/perl > > # !Monthly Access log reporting! > use strict; Alway's include "use strict;" to help point out logic errors. It forces you to declare all variables. I added 'my' declarations below to cause lexical scoping. > > chdir "/usr/netscape/server4/bin/https/lib" or die "Can't cd to > /usr/netscape/server4/bin/https/lib!\n"; > > my $WORKDIR='/webdata/perl/workarea'; > my $LOGDIR='/usr/netscape/server4/https-jcc/logs'; > my $server='jcc'; > my $tf=$WORKDIR/tf$$; > my $rf=$WORKDIR/rf$$; > my $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'; } Months are numbered from 0 because lets you use arrays and skip this messyness above. Also, you don't need to pass time() into localtime(). my $month = (localtime)[4] + 1; my $monthl = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')[(localtime)[4]] ; > my $lognames=`find $LOGDIR -name "access.$monthl*" -exec echo "-i" {} > "\c" \;`; > > # all data > print '*' . $lognames; > print "ALL data">$rf; I can't say I've got a clue what you are trying to do here. Whatever it is, its not modern perl syntax. If you can explain what it is that you want this script to do maybe I could write point you in the right direction. > /usr/netscape/server4/extras/flexanlg/flexanlg -n $server -m > $lognames -c huk -t u5h5 -l c15h15 -r -p ctl 2>&1 >> $rf; As pointed out before, this won't work. You can't just call another program like you can in a shell script. Again, I have no idea what it is you are trying to do so I can't tell you if there is a better way to do it. Try: system("/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; Again, this is not perl syntax. I'm suspecting more and more that this might be valid in an old version of perl. Now you have to open you files before you print to them: open LOG, $rf; print LOG "\n\n\n\nOff campus access, no 204 or 192 IP numbers"; close LOG; > 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; This is clearly not perl5 syntax, it doesn't look like perl at all. Sorry. - Johnathan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]