for (@rand) { if ( $rand[0]>=0 ) { shift @rand; } else { next; } }