my $i=0; for( $i=0; $i<=$n; $i++ ) { $list[$i] = &foo(1, 2, 3, 4, 5); if( $#list > &max_length ) { last; } my $result = &bar("$n", @list); if( $result > 999.999 ) { print STDERR "System halt"; exit; } }