On Mon, Mar 05, 2007 at 04:13:16PM +1030, Tom Lanyon wrote:
: Sounds like the following will work, but it doesn't seem 'nice'.
: 
: for @invoice
: {
:  .process;
:  1;
: } or fail 'No invoices to process';

Still think if there's no invoices it logically should be tested first.
If you don't want to repeat mentioning the array, how 'bout:

    @invoice or fail 'No invoices to process'
    ==> for @() {
        .process
    }

or equivalently

    @invoice or fail 'No invoices to process'
    ==> map {
        .process
    }

all assuming you don't like my original

    for @invoice || fail 'No invoices to process'
    {
        .process
    }

Larry

Reply via email to