Re: [EXIM] Exim-perl patch 0.2

Top Page
Delete this message
Reply to this message
Author: Dr Andrew C Aitchison
Date:  
To: Malcolm Beattie
CC: exim-users
Subject: Re: [EXIM] Exim-perl patch 0.2

On Thu, 15 Oct 1998, Malcolm Beattie wrote:
> The operator is used as follows
>     ${perl{foo}{argument}}
> and the resulting string is the return value of calling Perl
> subroutine foo on the given argument. If the sub returns the
> undefined value then the expansion fails and Exim panics with the
> error message: Perl sub "foo" returned undef. If the sub throws an
> exception via 'die "foo\n"' then the expansion fails and Exim
> panics with the error message passed to "die".


Is there any way for perl to fail gracefully, the way lookup does ?
Eg ${lookup <search type> {<query>} {<string1>} {<string2>}}
evaluates <string1> if the lookup succeeds and <string2> (which is often
the magic value 'fail') if the lookup fails.

(Note to Phil: Entries for "lookup" in the index all refer to chapter 6,
at least one reference to Ch 9.1 would be useful.)

Dr. Andrew C. Aitchison        Computer Officer, DPMMS, Cambridge
A.C.Aitchison@???    http://www.dpmms.cam.ac.uk/~werdna



--
*** Exim information can be found at http://www.exim.org/ ***