in reply to searching through multiple sqlite databases - attach problem

The following code
for(my $j = 1; $j<=4; $j++){ unless($j == 1){ } }
is equivalent to
my $j = 1;
You're looping four times, but doing processing only on the first loop. That's why you don't see the second table you believe you're creating.

I'd also suggest adding use strict; use warnings;.

Revised: to be a little clearer.

Revised (again): A better loop, btw, would be: for my $j ( 1 .. 4 ) {}

Replies are listed 'Best First'.
Re^2: searching through multiple sqlite databases - attach problem
by Anonymous Monk on Jul 05, 2011 at 02:03 UTC
    Nope: you are looping only three times - you miss $j == 1. Instead of writing "
    for (my $j == 1; $j <=4; $j++) {...}
    " you could write "
    for (my $j = 2; $j < 5; $j++) { ... }
    "