humble has asked for the wisdom of the Perl Monks concerning the following question:
But at run time after several successful cycles I get (when $index_cur==$index_prev): Can't "next" outside a loop block... So, it seems that next supposes it stands out of do-until. Why is so? How I can fix the issue?do{ $index_cur=int( rand( ( $last_abc_letter ) ) ); if( $index_cur==$index_prev ){ next; }else{ $index_prev=$index_cur; print "$letter[$index_cur]\n"; $key=&ReadKey( 0 ); } }until $key eq 'q';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: do-until: Can't "next" outside a loop block.
by 2teez (Vicar) on Nov 26, 2012 at 06:10 UTC | |
by humble (Acolyte) on Nov 30, 2012 at 04:57 UTC | |
|
Re: do-until: Can't "next" outside a loop block.
by marquezc329 (Scribe) on Nov 26, 2012 at 06:47 UTC | |
by humble (Acolyte) on Nov 30, 2012 at 04:58 UTC | |
by davido (Cardinal) on Nov 30, 2012 at 05:42 UTC |