Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

[solved] WWW::Mechanize::Firefox->new() tcp/ip port?

by ground0 (Novice)
on Mar 25, 2013 at 21:07 UTC ( #1025386=perlquestion: print w/ replies, xml ) Need Help??
ground0 has asked for the wisdom of the Perl Monks concerning the following question:

I know from reading perldoc I can set the Mozrepl plugin port by doing:

$ENV{MOZREPL} = 'localhost:42424';

However, this seem to cause strange problem when I use Parallel::ForkManager and $mech->content...

I am wondering if there is a way I can pass 'port => 42424' to constructor, as I see in Client.pm it take that argument.

Comment on [solved] WWW::Mechanize::Firefox->new() tcp/ip port?
Download Code
Re: WWW::Mechanize::Firefox->new() tcp/ip port?
by Corion (Pope) on Mar 25, 2013 at 21:11 UTC

    My personal advice is to avoid mixing fork and WWW::Mechanize::Firefox, unless you fork way before creating the connection to Firefox.

    The WWW::Mechanize::Firefox documentation specifies the repl parameter, which allows you to pass in:

    repl - a premade MozRepl::RemoteObject instance or a connection string suitable for initializing one

    I wonder how that could be formulated to be more clear so that you yould have found it directly.

      I tried with repl => "localhost:port" and I get same mixup. Somehow when $html = $mech->content happen in each fork it get confused and mix up all the $html.

      This make it so my temporary sanitized html files have wrong document element mixed in.

      Since this happen *in* the fork I guess I misunderstand when you say do way before the fork! :)

      PS) I forgot to mention this inside a *nested* fork, if that matter.

        Then maybe that mixup is not connected with how you construct your WWW::Mechanize::Firefox object?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-08-02 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (55 votes), past polls