in reply to uninitialized split value

If I replace the get_file sub with:

sub get_file { #to read from a file return <<SEQUENCE; #return the string sequence SEQUENCE }

I get:

Reading a file... Use of uninitialized value $record_type in hash element at noname1.pl +line 53. Parsing a file... Getting data... Use of uninitialized value $record_type in hash element at noname1.pl +line 59. Use of uninitialized value $seqres in split at noname1.pl line 194. Use of uninitialized value $lastchain in hash element at noname1.pl li +ne 222.

which is consistent with all those replies saying you need to handle blank lines.

Adding:

next if $line !~ /\S/;

as the first line of the for loop in parse_pdb_file cleans up 1/2 the warnings. Adding:

return if ! defined $seqres || $seqres !~ /\S/;

as the second code line of extractSEQRES fixes the rest. A better analysis of the code than I have done may suggest better places to detect and handle unexpected file content.

True laziness is hard work