saintex has asked for the wisdom of the Perl Monks concerning the following question:
I would like to call it just with new, without args:my $b=Selenium->new( host => "localhost", port => 4444, browser => "*firefox", browser_url => 'http://www.google.co +m', );
package Selenium; our $VERSION=0.01; use 5.010; use Moose; use MooseX::NonMoose; use Test::WWW::Selenium; extends 'Test::WWW::Selenium'; around BUILDARGS => sub { my $orig = shift; my $class = shift; my %args = ( @_ == 1 ? %{ $_[0] } : @_ ); $args{host}//="localhost"; $args{port}//=4444; $args{browser}//="*firefox"; $args{browser_url}//='http://wwww.google.com'; return $class->$orig(%args); }; sub BUILD { my $self = shift; #$self->start; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Problem with around BUILDARGS
by stvn (Monsignor) on Mar 24, 2011 at 13:32 UTC | |
by saintex (Scribe) on Mar 24, 2011 at 14:29 UTC | |
by saintex (Scribe) on Mar 28, 2011 at 10:58 UTC | |
by stvn (Monsignor) on Mar 28, 2011 at 17:01 UTC | |
by saintex (Scribe) on Mar 29, 2011 at 14:23 UTC | |
by saintex (Scribe) on Apr 19, 2011 at 16:45 UTC | |
by stvn (Monsignor) on Apr 21, 2011 at 00:49 UTC | |
|