in reply to Optional modules?
To add on to the suggestions above, I would also put it all in a BEGIN block.
#!/usr/bin/perl use strict; use warnings; use vars qw( $ne_loaded ); + BEGIN { eval "use Non::Existent"; if ($@) { warn "You don't have Non::Existent installed so..."; $ne_loaded = 0; } }
|
|---|