in reply to uninitalised value in numeric

Hmmm ... well $pos_end is intitialized but you could definetly set it to an undefined value with these lines:

$pos_end = $orf_array_pos[$orf_counter+1]

If your @orf_array_pos is not divisible by two. What happens when you come to the edge cases? (Like the tail of your @orf_array_pos? Try placing this line near the second setting of $pos_end.

if( ! defined( $orf_array_pos[$orf_counter+1] ) ) { print STDERR "Uhh ohh, going to undef $pos_end\n"; }

-derby