die "some usage error msg" if (@ARGV !=2); my ($domFile,$csafile)= @ARGV; open(CSAFILE, "$csafile") or die "unable to open $csafile: $!"; my %csa_hash; my %dom_hash; my $domain_dir = ""; while() { chomp; s/\s+//g; #keep things simple, delete spaces my ($pdb,$chain,$res) = (split(/,/, $_))[0,3,4]; push (@{$csa_hash{"$pdb;$chain"}},$res}); }