diff options
author | Bas Zoetekouw <bas> | 2008-09-30 18:43:19 +0000 |
---|---|---|
committer | Bas Zoetekouw <bas> | 2008-09-30 18:43:19 +0000 |
commit | 6128a6fa53b23aec8af4069d0e50598ab9ecfdac (patch) | |
tree | 2c63197ceafa2a5469416103b4c36a3e64ed61bd /check_trans.pl | |
parent | 46b186e46f0ecf137693b6f7f18006491fe9f488 (diff) |
Only load MIME::Lite and Email::Address if we actually need them (i.e., -m
option was specified)
CVS version numbers
check_trans.pl: 1.66 -> 1.67
Diffstat (limited to 'check_trans.pl')
-rwxr-xr-x | check_trans.pl | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/check_trans.pl b/check_trans.pl index 8e96437df73..646cc606da3 100755 --- a/check_trans.pl +++ b/check_trans.pl @@ -84,10 +84,8 @@ use File::Spec::Functions; use List::MoreUtils qw{ uniq }; use Term::ANSIColor; use File::Slurp; -use MIME::Lite; use Encode; #use Data::Dumper; -use Email::Address; use FindBin; FindBin::again(); @@ -784,6 +782,24 @@ sub parse_cmdargs ."(assuming you know what you're doing)\n"; } + # load additional module we need for mail + if ( $OPT{'m'} ) + { + eval { + require MIME::Lite; + import MIME::Lite; + }; + die "The module MIME::Lite could not be loaded.\n" + ."Please install libmime-lite-perl\n" if $@; + + eval { + require Email::Address; + import Email::Address; + }; + die "The module Email::Address could not be loaded.\n" + ."Please install libemail-address-perl\n" if $@; + } + if ( $OPT{'g'} and not $OPT{'m'} ) { die "Option -g (debuG mail) without -m (use mail) " |