Quote:
Originally Posted by match000
that's the bug i mentioned in my post above. you have to have an if statement for the PRINT statement also, do something similar to what i have in my code to fix this
basically you are not cathcing the case where there is a userID that has only ONE entry, and that one entry is a '-'..
|
Oops - good catch. Duplicating the if() with the regex is probably the right way to go here.
-RN
Quote:
Originally Posted by JStrider
robot parade I got the scripts running. and what do the use warnings/strict do?
your script is very close, only problem I see is when the field with the '-' in it is the first one for that ID it still includes it. this wouldnt have shown up using the little example dataset I provided.
I'm thinking that the way to go may to be have 2 different scripts. one that just deletes the rows with '-' in the query field. then after running it I run the one that my prof wrote to cluster it.
heres a link to where I downloaded the datasets from originally. http://www.gregsadetsky.com/aol-data/ its a really interesting dataset just to open up and look at and see what people are searching for.
|
Run 'perldoc warnings' and 'perldoc strict' for an in-depth explanation. Basically, together they warn you if you're doing 'unwise' things, like not initializing your variables with 'my', for instance. Experienced perl coders pretty much always use them. It just encourages better style, and fewer bugs.
I think match000's solution of testing for a '--' in the 'else' clause too is probably the best way to go there.