in reply to How do I test a script that doesn't have a .pl extension

I used Module::Loaded:
#!/usr/bin/perl BEGIN { $| = 1; $^W = 1; eval { use strict; use warnings; use Module::Loaded; my $script = mark_as_loaded('foo'); my $loc = is_loaded('foo'); }; } use strict; use warnings; use Module::Loaded; use Test::More tests => 1; require foo; require_ok('foo');

Replies are listed 'Best First'.
Re^2: How do I test a script that doesn't have a .pl extension
by Anonymous Monk on Nov 12, 2012 at 03:43 UTC

    I used Module::Loaded

    You failed. A .pl file is not a module, you shouldn't treat it as a module.