use Test::StubGenerator; my $stub = Test::StubGenerator->new( { file => '/path/to/MyModule.pm', } ); print $stub->gen_testfile;