in reply to Runtime syntax checking of a 'require'ed module

Try UNIVERSAL::require?

require UNIVERSAL::require; # Same as "require Some::Module" my $module = 'Some::Module'; $module->require or die $@;

Docs suggest using in a BEGIN block to emulate "use" which might work at compile time for you.

Replies are listed 'Best First'.
Re^2: Runtime syntax checking of a 'require'ed module
by ikegami (Patriarch) on Jul 03, 2008 at 01:14 UTC
    There's absolutely no advantage of using that module over eval require and it has the small disadvantage of requiring the installation of another module and the huge disadvantage of polluting every class and object.