in reply to smart match capture

without going through the array

mmmh, maybe "if exists"?

If what you want is to stop the search after find the first aa, you could use "last".

Replies are listed 'Best First'.
Re^2: smart match capture
by cdarke (Prior) on Oct 13, 2011 at 14:02 UTC
    Unfortunately, from exists in perlfunc:
    Be aware that calling exists on array values is deprecated and likely +to be removed in a future version of Perl.
    Not sure what you mean by "last", that exits a block. Maybe you were thinking of first in List::Util?
    my $retn = first {m/aa/} @a;
    But that is not using the smart-match operator (~~ not =~)