[Chicago-talk] pass a scalar from procmail to perl?

richard at rushlogistics.com richard at rushlogistics.com
Tue Dec 21 10:02:10 PST 2010

Mike to the rescue! That worked like a charm. Thank you very much. If I ever make it to PM meeting I seriously owe you a beer.

Thanks again,

------Original Message------
From: Mike Fragassi
Sender: chicago-talk-bounces+richard=rushlogistics.com at pm.org
To: Chicago.pm chatter
ReplyTo: Chicago.pm chatter
Subject: Re: [Chicago-talk]pass a scalar from procmail to perl?
Sent: Dec 21, 2010 11:09 AM

I suspect that $SUBJECT is being passed in as an environment variable. 
In other words, it'd be like the difference between these 2 command lines:

    SUBJECT=Foo perl -e 'print $ENV{SUBJECT}'


    SUBJECT=Foo perl -e 'print $SUBJECT'

So try $ENV{SUBJECT} instead of $SUBJECT.

If that doesn't work, it might be quoting: you may need to use 
double-quotes around the command after the -e.

> * ? perl -e 'require "/home/richard/.pmdir/test_subject.pl"; test_subj("$SUBJECT");'

-- Mike F.
Chicago-talk mailing list
Chicago-talk at pm.org

Watch our 3 minute movie: http://www.rushlogistics.com/movie

More information about the Chicago-talk mailing list