Re: Requiring roles

[email protected] (Sartak)
Newsgroups perl.moose
Message-ID <[email protected]>
On Thu, Jan 15, 2009 at 8:46 AM, Elliot Shank <[email protected]> wrote:
> Is there a way to avoid the duplication here:
>
>   use Foo ();
>   with 'Foo';
>
> Is there a way to get "with" (or something similar) to do a require?
>

This works for me. If you're using a really old version of Moose you
may need to upgrade.

perl -Moose -e 'with "MooseX::Getopt"; Class->new_with_options'
# doesn't explode :)

Shawn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.