Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Aug 1997 23:13:32 -0700 (PDT)
From:      Annelise Anderson <andrsn@andrsn.stanford.edu>
To:        freebsd-questions@freebsd.org
Subject:   cops/perl problem
Message-ID:  <Pine.BSF.3.96.970802225334.4094A-100000@andrsn.stanford.edu>

next in thread | raw e-mail | index | archive | help
I installed cops (on 2.2.2-S) and decided to run the perl version.  
Here are the opening lines of the perl script cops:

#!/bin/sh -- need to mention perl here to avoid recursion
'true' || eval 'exec perl -S $0 $argv:q';
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec /usr/local/bin/perl -S $0 $argv:q'
        if 0;

I got an error message: can't open need.  So I commented out what
looked like a comment.  Then I got an error message about -S being
an invalid option.  So I commented out the whole block and used
#!/usr/local/bin/perl 
instead.

Then it complained about precedence problems with the following lines,
wanting parens around CONFIG, FILE1, and FILE2.  (Roughly lines 86,
222, and 223.)  So I provided parens....

open CONFIG || die "can't open $CONFIG: $!";
    open FILE1 || die "can't open $FILE1: $!\n";
    open FILE2 || die "can't open $FILE2: $!\n";

and it ran fine, complaining only that the "andrsn" in the
specification of the USER to receive mail (root@andrsn.stanford.edu)
in the config file needed to be escaped.  :)  (Of course it also
complained about the number of fields in the password and group
files and other stuff, but that's what it's supposed to do.)

Maybe it would have been okay with perl 4, from /usr/bin....or
was I doing something wrong?

	Annelise













Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.970802225334.4094A-100000>