procmail
[Top] [All Lists]

Re: Global variable

2002-06-12 02:49:49
Problem is that variable TESTER act as local variable in C or Pascal style.

Nope - it is global.

That is value of TESTER set in subfunction of recipe AA is erased
after subfunction is left.

Do you want to include a verbose log showing this happening so that we
can narrow down what the problem is?  Plus anything else that you think
shows that TESTER is acting in a local way.  The actual recipe you are
using would be a help in case it contains some feature you didn't think
to include in your generalisation.

I don't know too quite how call in english that area between { and }
;-)) so I call it subfunction

Nested block is the usual term.  But you were clear enough :-)

Here is a test recipe:

  VERBOSE=1
  TEST=22
  :0
  {
    :0iw
    TEST=| echo "33"
  }

  :0:
  * TEST ?? 22
  testislocal

  :0:
  * TEST ?? 33
  testisglobal

and here is my log output:

  procmail: [2391] Wed Jun 12 10:39:03 2002
  procmail: Assigning "TEST=22"
  procmail: Assigning "TEST="
  procmail: Executing "echo,33"
  procmail: No match on "22"
  procmail: Match on "33"
  procmail: Locking "testisglobal.lock"
  procmail: Assigning "LASTFOLDER=testisglobal"
  procmail: Opening "testisglobal"

if you try that recipe and get a different result (delivery to
'testislocal', or delivery to neither) then please let us see the log
output and what version of procmail you are running on what machine.

Hope that helps,
Martin
-- 
Martin McCarthy                 /</    http://procmail.non-prophet.org
    `Procmail Companion'        \>\
     Addison Wesley             /</                  PGP key available
_______________________________________________
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>