- or download this
package Factory;
use base qw( Class::Factory );
...
__PACKAGE__->add_factory_type('2.0' => 'Module_2');
1;
- or download this
package Module_1;
sub new { bless {}, shift }
...
sub version { '1.0' }
1;
- or download this
package Module_2;
sub new { bless {}, shift }
...
sub version { '2.0' }
1;
- or download this
#!/usr/bin/perl -l
...
Factory->new('1.0'),
Factory->new('2.0'),
;