On Thu, 3 Jan 2008, David Dyer-Bennet wrote:
The opening brace is the action.....
alternative that I hadn't considered is "a brace isn't a block-grouping
element" in anything like the sense I'm used to.
Actually, the brace works as intended. As with other languages, you can
substitute the brace for a single action line. What is 'different' is
that an 'action line' is not a 'stand alone' language element. For
example, you couldn't have THIS for a procmailrc
:0
*condition1
/mailbox1
/mailbox2
:0
*condition3
/mailbox3
It wouldn't know what to do with '/mailbox2'.
So that syntax is equally invalid within a brace construct.
Even the syntax:
:0
*condition
{
action
}
....is invalid, for the same reason. As soon as you enter the brace,
you are starting 'fresh' with your syntax.
. (dot) is special in procmail regexps and so needs escaping when you
want to match a real dot. Here I use the character class delimiters to
escape it - it also makes it standout so that _I_ notice that is what I
will get. As for the [(_at_)], I could probably just have used an @ on its
own, but, again, it does highlight for me, the human with the poor
memory, what the final character of the match is.
Plus which, in a few places I have had regex-like code complain about a
bare '@' or treat it specially. So unless you are paying very close
attention, sometimes a generic "[(_at_)]" is just easier to use consistently.
- Charles
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail