my $more = 5; while ( $more && ) { . . . # $more-- with each successful assignment so $more will be 0 when all five variables are known . . . }