#!/usr/bin/perl -w use strict; use warnings; my $ctfile = "ct.tab"; my $dg; my $nt; my $min = 3; my $max = 19; my %hash; open (A, "<", $ctfile) or die "Check the file $!"; while (my $line = ) { chomp $line; if ($line =~ /dG\s=\s(.*?)\s/) { $dg = $1; next; } my @temp = split(/\s+/, $line); my $snum = $temp[0]; $nt = $temp[1]; # $nt =~ s/[Tt]/U/g; my $connect = $temp[4]; $hash{$nt} = $connect; } foreach my $key (keys %hash) { print "$key\t$hash{$nt}\n"; }