my ($orf_file) = @_; my $record_length = 230; open ORF_DATA, "<$orf_file" or die "Can't open $orf_file: $!\n"; binmode ORF_DATA; # Tell Perl this isn't a text file my $buffer; while (read ORF_DATA, $buffer, $record_length) { my ($orf_name, $orf_left, $orf_right, $orf_direction, $orf_descr) = unpack("x5x4A11x4x4x1a8x1a8x4A1x4x14x4x5x1x8x4A50", $buffer); foreach my $coordinate ($orf_left, $orf_right) { $coordinate = unpack("d", reverse($coordinate)); } print "$orf_name, $orf_left, $orf_right, $orf_direction, $orf_descr\n"; } read ORF_DATA, $buffer, 5; close ORF_DATA;