At 09:37 AM 9/12/00 -0400, Jerrad Pierce wrote:
>Doh! perhaps then more like:
>
> #grep for str's beginning and ending in a digit
> grep ITEM: { /^[1-9]/; next ITEM unless /[1-9]$/ } @list;
>
>Of course there are other ways of writing this...
>Are there any cases people want this for that CANNOT be rewritten?
>Or is it purely syntactic sugar? Not that that is a bad thing,
>as I've mentioned I think a way to short-circuit/bypass/"return" from
>an otherwise undistinguished block would be nice. There have been
>many times I've wanted to do same.
I think it's fine to allow a loop label on the grep block, but it wasn't
really what I thought we were discussing; you still haven't indicated what
the value of the block should be on that iteration. undef is a reasonable
default but how to provide another? That's what my idea was, to provide a
second argument. Also, shouldn't be necessary to label a loop if you don't
have another one inside it, although if you did, it would avoid the
embarrassment of "last undef, 'foo'" that fell out of my suggestion.
--
Peter Scott
Pacific Systems Design Technologies