Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Perl Modules with 2 or more classes

by zwon (Abbot)
on Oct 19, 2011 at 14:30 UTC ( #932419=note: print w/replies, xml ) Need Help??


in reply to Re: Perl Modules with 2 or more classes
in thread Perl Modules with 2 or more classes

Or you can create classes dynamically with Class::MOP::Class and Moose::Meta::Class

use 5.012; use warnings; use Class::MOP; for (qw(foo bar baz)) { my $class = ucfirst($_); Class::MOP::Class->create( $class => ( methods => { $_ => sub { say $class } } ) ); } Foo->foo; Bar->bar; Baz->baz;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932419]
help
Chatterbox?
[1nickt]: Ya gotta love the google. If you set accept=".txt" in a form input field where type="file", Chrome will allow you to select local files with extensions like .pl, .pm, .yaml, .ini etc. Nice!

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2017-07-22 18:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (340 votes). Check out past polls.