Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Nested loops?

by Speed_Freak (Sexton)
on Aug 17, 2017 at 21:05 UTC ( [id://1197579]=note: print w/replies, xml ) Need Help??


in reply to Re: Nested loops?
in thread Nested loops?

I'm currently trying out exists, thanks for that! In the example above, I would have to put the "filter" keys in the exists, because the $x becomes the sequence that gets augmented and compared to all $x's. So, if the key in %two exists as a key in %one, then the key from %one becomes the target. Which then gets assigned to a new variable with each option from the base list. Those are then checked against the $x keys for matches.

foreach my $sql1 (@{$sql1}) { $table1{$sql1->[1]}{$sql1->[0]}=undef; #rearranges the sql pull - + large table of sequences and id's - These get used to create the alt +s and house the entire list that needs to be searched } foreach my $sql2 (@{$sql2}) { $table2{$sql2->[1]}{$sql2->[0]}=undef; #rearranges the sql pull - + "filter" table of sequences and id's - Only used to dictate which se +quences get used from the large table my @bases = ('A','C','G','T'); foreach my $x (keys %table1){ if (exists $table2 ({$x})) { my $found_alt = 0; foreach my $bases (@bases) { my $alt = $x; substr($alt, 20, 1) = $opt; next if ($alt eq $x); if (exists $table1{$alt}) { $found_alt = 1;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1197579]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-25 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found