my @targets = split (/\|/,$mech_results->{'Targets'}); my @actions = split (/\|/,$mech_results->{'Mechanism of Action_type'} ); my $a = sprintf "targets: %s | actions: %s |", join( ":", @targets ), join ( ":", @actions ); warn $a; my $iteration = each_array(@targets,@actions); #my ($targets,$actions) = targetsSynced(\@targets,\@actions); #warn scalar @targets. '|' . @actions; if(scalar @targets eq scalar @actions){ }else{ while(my($targets,$actions) = $iteration->()){ next if ($targets|$actions) eq ''; # targets with more than one reference. if($targets =~ /(\(?\w+\))?(?:[ \/](.*))/){ my ($target, $tar_ref) = $targets =~ /\(?(\w+)\)?(?:[ \/]((.*)))/; my ($tarref_no) = $tar_ref =~ /\[(\d)\]/; my ($action,$act_ref) = $actions =~ /(.*)?\s\[(.*)\]/; my @act = split(/,/,$act_ref); foreach my $af(@act){ #warn "$af,$tarref_no $target, $action"; } } }