develooper Front page | perl.moose | Postings from February 2012

Re: General Moose/Perl OO question

Thread Previous | Thread Next
From:
Dave Rolsky
Date:
February 9, 2012 11:06
Subject:
Re: General Moose/Perl OO question
Message ID:
alpine.DEB.2.00.1202091305120.14177@urth.org
On Thu, 9 Feb 2012, shtil@comcast.net wrote:

> This begs a question: what to put in the main program if the class knows all it needs to run?
> The usual pattern is:
>
>
> use MyMooseClass;
>
>
> my $obj = MyMooseClass->new_with_options;
>
>
> $obj->run; # Or something alike
>
>
> This looks like redundant.
>
>
> I was thinking about using
> perl -MMyMooseClass ...
>
>
> This of course assumes that MyMooseClass is a singleton.
>
>
> Any thoughts?

Having an executable is useful. It's like every other Unix program, it's 
in the path, it's what people expect.

Writing this executable takes about 10 seconds and you never need to 
change it. Why not include it?


-dave

/*============================================================
http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)
============================================================*/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About