Re: proper way to assign return value to a variable

Richard Reina <[email protected]>
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
Holger,

Thank you very much for your reply.  I really appreciate it.  I see what
your saying about ?.  However, also need the return value so that I can feed
it to another script.

Thanks



2010/12/30 Holger Wahlen <[email protected]>

> * Richard Reina wrote:
> > :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.
>
> Actually "?" conditions make it even easier to do what you want, you
> don't need to capture the return value yourself and compare it to 0
> explicitly in later recipes: if you add an action line to your recipe,
> this action will only be executed if the script returns 0, and you can
> add another recipe with an "E" flag to deal with the "else" case.
>
> :0
> * ? your_perl_script
> | pipe_to_execute_if_script_returns_0
>
> :0 E
> | pipe_to_execute_if_script_returns_something_else
>
> /HW
> ____________________________________________________________
> procmail mailing list   Procmail homepage: http://www.procmail.org/
> [email protected]
> http://mailman.rwth-aachen.de/mailman/listinfo/procmail
>

____________________________________________________________
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.