BEGIN { # This unless block just seems a little clearer than the # way you were doing it. # unless (eval { require Term::Menus }) { print "INSTALLING PERL Term::Menus MODULE\n\n"; system("/opt/hp/hadooptools/validation/smoke/cpan.sh Term::Menus"); } } use Term::Menus;