in reply to Re^2: foreach my $question (@perlmonks){}
in thread foreach loop not retrieving all data.

Well, there's your problem!

This is essentially your code

my @tables = ( { 'h2' => [ .. ], 'div/a' => [ .. ], }, ); for my $table( @tables ){ my $oneh2 = $table->['h2']->[0]; my $onediv = $table->['div/a']->[0]; }

You're asking why this doesn't look for multiple h2s or divs -- do you see why it doesn't?

Replies are listed 'Best First'.
Re^4: foreach my $question (@perlmonks){}
by marcoss (Novice) on Jun 19, 2012 at 11:00 UTC

    Yes!!, I finally got it working...I feel st_p_d, jejeje. Just a question. Should I update my initial post with the right code or do something like "solved"?

    Thanks!!

        But only very slightly better since the actual problem had nothing to do with html or xpath.