I'm aware that my ($item) = grep(/$pat/,@list); stops grep upon the first successful match.
Actually, I don't think that's true (unless it's some optimization that's been applied to recent perls). What it does is generate the entire list and then throw away all of the items except for the first one.
But, since I haven't kept up with all of the optimizations that have been applied to perl over time, I don't know if that's still the case.
Anyway, what it looks like you've done is re-invent a specific application of List::Util::first.
In reply to Re: RFC: Text::Grap
by duff
in thread RFC: Text::Grap
by kwaping
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |