in reply to Re^2: Passing arguments to WWW::Mechanize::Firefox constructor with Moose
in thread Passing arguments to WWW::Mechanize::Firefox constructor with Moose

OK, wow, thanks for the links and sample code. I will definitely study these closely.

While I have you ear right now, what if I want to override a method in the parent class (WWW::Firefox::Mechanize)? Is delegating, as shown in your first link, still the best option? Here's some code pseudocode to try to convey what I mean:

use WWW::Mechanize::Firefox; has 'bot' => ( is => 'ro', isa => 'WWW::Mechanize::Firefox', ); sub get { my ($self, $url) = @_; $self->bot->get($url, synchronize => 1); }

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

  • Comment on Re^3: Passing arguments to WWW::Mechanize::Firefox constructor with Moose
  • Download Code

Replies are listed 'Best First'.
Re^4: Passing arguments to WWW::Mechanize::Firefox constructor with Moose
by kcott (Archbishop) on Mar 11, 2016 at 17:13 UTC
    "OK, wow, thanks for the links and sample code."

    You're welcome.

    "I will definitely study these closely."

    I encourage you to spend a little more time, improving your foundation Moose skills and knowledge, before delving into MooseX-land. I suggest you read the Moose manpage: it's not overly long and has many links to cookbook examples, more detailed information, and so on: follow as requirement, or curiosity, take you.

    "I'm a newb with Moose."

    See Moose manpage: New to Moose?.

    "if I want to override a method in the parent class ..."

    See Moose manpage: override ($name, &sub).

    — Ken

      I always a struggle to determine when I've learned enough to try to cut my teeth on writing real code. I wish I were the type that could just read through documentation and grok it immediately but often my eyes just glaze over as I try to figure out whether what I'm reading can be applied to the specific task I want to accomplish.

      So your timely advice gives me practical guidance I can chew on while I search for a good solution. I appreciate it.

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