Larry Wall wrote:
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
Ah, I missed that last one when you originally posted it.
All three of those are quite sufficient solutions in my mind.
p.s. Could the latter 'for @foo || fail { }' cause confusion with 'for
@foo {} or fail' ?
--
Tom Lanyon