Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Hash table checker doesnt work

by ferreira (Chaplain)
on Apr 10, 2007 at 10:03 UTC ( [id://609096]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-19 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found