procmail
[Top] [All Lists]

Re: Perl scripts not recognized as such?

2008-12-04 11:29:56

in the stupid question category: Have you checked your permissions to ensure that the script is executable?

Also check your script. you have an error there somewhere (probably line 10)

/home/staff/billo/Mail/billo2.pl: syntax error at line 10: `)' unexpected

--Curtis

Bill Oakley wrote:
Hello,

I'm using procmail to spool my "interesting" mail to my system mailbox
and my "uninteresting" mail to a secondary mailbox.  Specifically, I'm
using a Perl script and testing it's exit status.  My recipes are:

:0Wi:
* ? $HOME/Mail/billo2.pl
$HOME/Mail/billo2

:0:
$DEFAULT

My Perl script begins with:

#!/usr/local/perl/bin/perl

The problem I'm seeing is that sometimes the Perl script doesn't seem
to be recognized as a Perl script; my procmail log file contains:

procmail: Executing "/home/staff/billo/Mail/billo2.pl"
/home/staff/billo/Mail/billo2.pl: my: not found
/home/staff/billo/Mail/billo2.pl: my: not found
/home/staff/billo/Mail/billo2.pl: my: not found
/home/staff/billo/Mail/billo2.pl: syntax error at line 10: `)' unexpected
procmail: Non-zero exitcode (2) from "/home/staff/billo/Mail/billo2.pl"
procmail: No match on "/home/staff/billo/Mail/billo2.pl"

It's as though the Perl script is being interpreted as a shell script.
(And if I remove the "#!" line and run the script interactively I see
the same errors.)  But again, this only happens some of the time - the
rest of the time the script runs and the messages are spooled
correctly.

Any ideas about what the problem may be?

Thank you for your help.

Bill
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail