foreach my $auth (@auth_methods) { my $obj = $auth->new; my $rv = $obj->authorize($user, $pass); ... }