sub parse_pdb() { my $file = shift; my %hash_pdb = (); # Opening of PDB file after dowloading open(FH, $file); @atomrecord = ; foreach my $record (@atomrecord) { chomp($record); if($record =~/^ATOM/) { @temp = split(/\s+/, $record); $con_key = ""; $con_key = "$temp[3]"." "."$temp[4]"; $count = 0; if( $hash_pdb{$con_key} ) { if($val_seen{$temp[5]}) { } else { $hash_pdb{$con_key} = $hash_pdb{$con_key}."\t"."$temp[5]"; } } else { $hash_pdb{$con_key} = $temp[5]; } $val_seen{$temp[5]} = 1; } if($record =~ /^ENDMDL/){ print "i am going out of loop\n"; last; } } return \%hash_pdb; }