procmail
[Top] [All Lists]

Re: Bit wise &

2003-09-16 08:05:37
Homer asked two questions, and Klaus answered both.  This was the second:

S>     Can environmental variables created inside a perl
S> script survive back to procmail once the script is ended?

and Klaus replied,

R> No, but again you can call Perl and interpret the return value,

Klaus didn't illustrate that, but I gather he meant something like this:

 versetbyperl=`/usr/bin/perl -T -w /home/user/script.pl`

or, if your version of procmail and your OS form a combination under which this usage doesn't cause a segmentation fault,

 :0 flags # can include `h' or `b' to reduce input to perl
 * conditions if any
 varsetbyperl=| /usr/bin/perl -T -w /home/user/script.pl

where perl puts the value you want for the variable onto stdout. Certainly that's the way to go if you want to get only one variable back from perl. But if you need to get two or more variables out of one call to perl, I can't improve on Klaus's suggestion:

R> or call
R> Perl as a filter and store values in X- header fields, e.g.

R> :0 hfw
R> | /usr/bin/perl -T -w  /home/user/script.pl

R> where script.pl adds headers with information you want to use later in
R> the program.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>