note
AnomalousMonk
<p>
Here's my guess:
<c>
c:\@Work\Perl>perl -wMstrict -le
"use List::MoreUtils qw(any);
;;
sub myfunc { return map { int rand 10 } 1 .. $_[0]; }
;;
my @List_new;
;;
UNTIL_TRUE: {
@List_new = myfunc(7);
any { $_ == 3 } @List_new or redo UNTIL_TRUE;
}
;;
print qq{@List_new};
"
0 1 6 1 8 1 3
</C>
<b>Notes:</B>
<ul>
<li>[metamod://List::MoreUtils]<c>::any()</C> can be replaced with the built-in [doc://grep] for short lists (for some definition of "short").
</LI>
<li><c>any()</C> may also be found in [metamod://List::Util] in later versions of Perl.
</LI>
<li>The label <c>UNTIL_TRUE</C> is not needed, it's just documentary.
</LI>
</UL>
</P>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-634253">
<hr><p>Give a man a fish<b>:</B> <c> <%-{-{-{-<</C></P>
</div></div>
11139196
11139196