Shashi
Shashi

Reputation: 341

Perl : Perform syntax check of perl module before re-load

How can we perform a syntax check , before we try to load the perl module dynamically?

We push DIV rendering Perl modules , and have written a re-load module that loads these Perl modules based on modification time stamp.

And would like to incorporate a quick compilation check on these perl modules ( something similar to perl -wc ) , to see that the module to be re-loaded is all good to be re-loaded.

Upvotes: 0

Views: 139

Answers (1)

daxim
daxim

Reputation: 39158

syntax_ok in Test::Strict provides a wrapper around perl -c for arbitrary Perl code in a file.

require_ok/use_ok in Test::More do something similar for modules.

Upvotes: 3

Related Questions