Ok, I think I might have solved it. Perlmonk.org is down momentarily so I cant confirm as of yet.
Before, if I had 10 pages of results to retrieve, I simple GoT each one using a for loop, which updated the search string for each GET. If I failed to get the 3rd page, then pages 4, 5, 6, 7 etc all failed too. But, if I was using my browser, I could skip a page of the search and things continued to work fine. So say I was on page 5, instead of hitting next, I could change the search string and check page 7. That led me to think that my prog was failing because my session id suddenly became out of date and it would therefore make sense that nothing else after that would work either, which is what was happening.
But now, I simply recall a page when it fails, and everything suddenly works again and I can then get 4, 5, 6, 7 etc. :) - once I've sucessfully received page 3
Why does a page fail at all? - well I ran the loop above in such a way that it would continue infinetly - say 0, 1, 2, 3, 0, 1, 2, 3...
I noticed that page 2 or 3 would normally fail at the fist attempt, but once I got passed that, pages 2,3,0,1,2,3,0,1,2,3... all worked fine - it only seems to fail once.
So now I simply decrement my loop counter on a fail, and set an error watch to make sure I dont get caught in this loop indefinitely
Anyway, thanks to all those who gave suggestions ;)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.