On Thu, Jun 9, 2011 at 17:42, <sono...@fannullone.us> wrote: > Using either require, use, or do produces an error if I run the script > without the module. Is there a specific function for this purpose, or would > I have to do something like wrap a 'use' or 'require' in an if statement? > I've tried that and it doesn't work so maybe I'm way off base on that one.
Something like: my $module_is_enabled = 0; eval 'use My::Special::Module'; $module_is_enabled = 1 unless $@; should do what you're looking for. j. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/