I'm a newb with Moose. I have the following perl script which creates an FFMech object:

#!/usr/bin/perl BEGIN { unshift @INC, "/home/steve/perl/perl-lib" } use strict; use warnings; use FFMech; my $ffm = FFMech->new;

The code for the FFMech object is here:

package FFMech; use strict; use warnings; $ENV{'DISPLAY'} = ':0.0'; use X11::GUITest qw/SendKeys FindWindowLike ClickWindow SetEventSendDe +lay/; use Moose; extends 'WWW::Mechanize::Firefox'; has 'window_id' => ( is => 'ro', isa => 'Int', );

As you can see, the class doesn't do anything. That's because I can't get over the initial hump of initializing the object without getting the following error:

Failed to connect to , problem connecting to "localhost", port 4242: C +onnection refused at /usr/local/share/perl/5.20.2/MozRepl/Client.pm l +ine 144

The error is occurring because Firefox is not running. You can launch Firefox with something like:

my $mech->new(launch => 'firefox');

However, I'm at a loss as to how to pass these arguments to the constructor for the WWW::Mechanize::Firefox object.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
$nysus = $PM . $MCF;
Click here if you love Perl Monks


In reply to Passing arguments to WWW::Mechanize::Firefox constructor with Moose by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.