Good time!
Not that it is my first script in PERL, yet I can not understand why I have such a problem w/ following simple cycle:
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';
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?