in reply to Re^3: confusing constructor code
in thread confusing constructor code

Of course you need to do my $class = shift;. I didn't see a reason to write the full code. You have to die() instead of warn() if explicit check is needed. Ignoring bogus parameters is a way too.