Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How do I test a script that doesn't have a .pl extension

by Khen1950fx (Canon)
on Nov 02, 2012 at 03:41 UTC ( #1001911=note: print w/ replies, xml ) Need Help??


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');


Comment on Re: How do I test a script that doesn't have a .pl extension
Download Code
Reaped: Re^2: How do I test a script that doesn't have a .pl extension
by NodeReaper (Curate) on Nov 02, 2012 at 06:41 UTC
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1001911]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (16)
As of 2014-04-18 14:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (469 votes), past polls