in reply to Hash table checker doesnt work

Update: That was a mistake. I didn't know what I looked at to see this error that isn't there.

The first thing I spotted in your code was:

next unless $token->[1]{href} =~ /\?page=/ || $token->[1]{class} =~ /t +op10_link/;
which has some precedence problems. You really meant:
next unless ($token->[1]{href} =~ /\?page=/) || ($token->[1]{class} =~ /top10_link/);
or
next unless ($token->[1]{href} =~ /\?page=/) or ($token->[1]{class} =~ /top10_link/);

Replies are listed 'Best First'.
Re^2: Hash table checker doesnt work
by hodashirzad (Novice) on Apr 10, 2007 at 10:30 UTC
    Thanks the code you said works but gives me errors (uninitialised) for the links that havent got class identified so I decided to use if statement instead of next unless :
    next unless defined($token->[1]{href}) || defined($token->[1]{class}) +; if (defined($token->[1]{class}) && $token->[1]{class} =~ /top10_link +/){ do some code } if($token->[1]{href} =~ /\?page=/){ do some code }
    Thanks again