#!/usr/bin/perl -w
use strict;

dump_data("7120DB.DAT");

sub dump_data {
   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) {
      foreach my $i (0 .. length($buffer) - 1) {
         my $c = substr($buffer, $i ,1);
         my $d;
         if ($c =~ /[ a-zA-Z0-9.]/) { $d = $c }
         else { $d = "#" }
         substr($buffer, $i, 1) = $d;
      }
      print "$buffer\n";
   }
   close ORF_DATA;
}
