General Moose/Perl OO question
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <965121627.858139.1328811670898.JavaMail.root@sz0115a.emeryville.ca.mail.comcast.net> |
Hi All, Moose provides an excellent interface with command line args via MooseX::Getopt. It looks like a class constructor can consume all options and once done so is ready to roll. 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?