[ { "PDBS": [ { "BLOCKS": [ { "PSTART": "1571", "PEND": "1589" } ], "PDB_CHAIN": "B", "PDB_TITLE": "Solution Structure of the Complex of the PTB Domain of SNT-2 and 19-Residue Peptide (Aa 1571-1589) of HALK", "PDB_ID": "2KUP" }, { "BLOCKS": [ { "PSTART":"1095", "PEND":"1136" }, { "PSTART":"1144", "PEND":"1274" }, { "PSTART":"1289", "PEND":"1401" } ], "PDB_CHAIN":"A", "PDB_TITLE":"Structure of Human Anaplastic Lymphoma Kinase in Complex with Nvp-tae684", "PDB_ID":"2XB7" } ], "PROT_NAME": "ALK" } ] #### my $json; { local $/; open my $fh, "<", "struc_cover_edu.json"; $json = <$fh>; close $fh; } my $data = JSON->new->decode($json); my $position = 1200; for my $s (@$data) { next unless $s->{PROT_NAME} eq 'ALK'; foreach my $p (0 .. $#{$s->{PDBS}}) { foreach my $b (0 .. $#{$s->{BLOCKS}}) { my @blocks = @{ $s->{BLOCKS}}; if ($position >= $blocks[$p][$b]{PSTART} && $position <= $blocks[$p][$b]{PEND} ){ print ($b->{PDB_ID},"\n");} } }}