in reply to Re: Re: Encapsulation and Subroutine redefined warnings
in thread Encapsulation and Subroutine redefined warnings

If you want to loop over a list of subclassed processors, you probably want something like:

use Processor; use Processor::SomeSubClass; use Processor::AnotherSubClass; foreach ( qw( SomeSubClass AnotherSubClass ) ) { my $pkg = "Processor::$_"; my $processor = $pkg->new(); $processor->init(); # do something with $processor }

Damien Conway's book is very good on OO perl, although he skips fast past some of the simple stuff.

qq