title: Find nucleotides in DNA sequence with perl
body: <p>I have the sequence DNA and I want to find nucleotide of the sequence at the position which was chosed by people. Below is the example:</p>
  
  <p>Enter the sequence DNA:
  ACTAAAAATACAAAAATTAGCCAGGCGTGGTGGCAC (the length of sequence is 33)
  Enter the position: (12)</p>
  
  <p>I hope the result is the position number 12 the nucleotides are AAA.</p>
  
  <p>I have no problem finding the amino acid of the position. Below is the current code I have. </p>
  
  <pre><code>print "ENTER THE FILENAME OF THE DNA SEQUENCE:= ";
  $DNAfilename = &lt;STDIN&gt;;
  chomp $DNAfilename;
  unless ( open(DNAFILE, $DNAfilename) ) {
    print "Cannot open file \"$DNAfilename\"\n\n";
  }
  @DNA = &lt;DNAFILE&gt;;
  close DNAFILE;
  $DNA = join( '', @DNA);
  print " \nThe original DNA file is:\n$DNA \n";
  $DNA =~ s/\s//g;
  
  print" enter the number ";
  $po=&lt;STDIN&gt;;
  
  @pos=$DNA;
  if ($po&gt;length($DNA)) 
  {
    print" no data";
  }
  
  else 
  {
    print " @pos\n\n";
  }
  </code></pre>
  
  <p>Please advice how can I find the position at the DNA sequence.</p>