proper way to assign return value to a variable

Richard Reina <[email protected]>
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
If anyone could please help me with this I would REALLY, REALLY appreciate
it.  I find procmail very cryptic for me and I am endangering my job by
falling way behind on my other work -- not to mention neglecting my family.
Any help would be greatly appreciated. Currently I have a recipe that calls
a perl script like this:

:0 w # send to test_subject.pl check for order no.
* ? /usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl";
test_subject($ENV{SUBJECT};'

This works fine, but what I need is to capture the return value of the
script so that I can compare it in a conditional and depending on the result
use it in another called script.  Something like the following:

:0
PO=`/usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl";
test_subject($ENV{SUBJECT};'`

:0:
* PO ?? 0  # if PO equals zero. PO is NOT valid
|( formail -rI"From: Responses will be automatically discarded <
[email protected]>"; \
   echo "Your mail has been administratively rejected."; \
   echo "PO is not valid." \
 ) | /usr/sbin/ssmtp -oi -t
:0
{# else PO is valid strip the attachments and file it
| ( ripmime -i -d /home/richard/.pmdir/attachments/  )
| /usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl";
rename_attachments($ENV{PO});'

If anyone could please help me.  I would really, really appreciate it. I'm
in dire straights.

Thank you very much for you consideration.

Richard

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
[email protected]
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.