use strict; use warnings; use Test::More tests => 1; my $new; BEGIN { require MIME::Lite; $new = MIME::Lite->can ("new"); undef &MIME::Lite::new; } sub MIME::Lite::new { print "Validating MIME::Lite::new params\n"; #goto $new; #return $new->(@_); return &$new; } ok (checkSub (), 'Match existing path'); sub checkSub { my $msg = MIME::Lite->new ((To => 'to', )); my $result = eval {$msg->send}; }