}
my $constructor_params = ( @params == 1 ? $params[0] : {@params} );
-
+
Carp::croak("Single parameters to new_with_options() must be a HASH ref")
unless ref($constructor_params) eq 'HASH';
# did the user request usage information?
if ( $processed{usage} && ($params->{'?'} or $params->{help} or $params->{usage}) )
{
- $processed{usage}->die();
+ $class->_exit_with_usage($processed{usage});
}
$class->new(
);
}
+sub _exit_with_usage {
+ my ($self, $usage) = @_;
+ $usage->die();
+}
+
sub _parse_argv {
my ( $class, %params ) = @_;