use strict; use Getopt::Std; #Invokes Get options package our ($opt_c,$opt_e); getopts('ce:'); my @seq = <>; chomp(@seq); my $seq = join("", @seq); our %re = ( 'BamHI' => 'GGATCC 1', # G | GATCC 'EcoRI' => 'GAATTC 1', # G | AATTC 'EcoRII' => 'CCWGG 0', # | CCWGG ); my @enz = split(/\b(\s+)\b/,$re{$opt_e}); my $enzseq = $enz[0]; my $cut = $enz[2]; print "The restriction site is: $enzseq\n\n"; while($seq =~ /($enzseq)/ig) { my $site = pos($seq),"\n"; print "$site\n"; }