Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Welcome to the Monastery
 
PerlMonks  

Re^4: Parallel::ForkManager memory mixup?

by ground0 (Novice)
on Mar 30, 2013 at 14:07 UTC ( #1026271=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Parallel::ForkManager memory mixup?
in thread [solved] Parallel::ForkManager memory mixup?

So I woke up this morning and tried this kludge:

$temp = $mech->uri; (undef, $uri) = split (/(\?.*)/, $temp);
I next concatenate session ID in $uri with $url:
$url .= $uri;

Now when I $mech->get($url); etc. and follow with $html = $mech->content; etc. my temporary HTML has proper snippet per fork child!

At Corion's request I did some more debugging, and with FireBug plugin I found this to be an edge case. When a site issues a default, non-random session ID on loading a page, and then links to itself without passing a real session ID... the result is each fork that goes to work on the same offending URL gets jumbled on the next $mech->get($url);

I'm going to mark this solved since each fork was getting the same default fake session ID, and my kludge should be adaptable to any site doing this. With the obvious caveat being you'll need to $mech->get() something that issues you a valid session ID prior to the kludge!


Comment on Re^4: Parallel::ForkManager memory mixup?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-04-18 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (464 votes), past polls