#====================== #BEGIN MODULE VALIDATOR #====================== #!/usr/intel/bin/perl -dw use vars qw( $TOP_MODULE $DEBUG ); use pm::Common; use package_name::module; $DEBUG=0; $TOP_MODULE="Module Validator"; &error(-1, "Inappropriate arguments specified! One, and only one, module must be defined") if($#ARGV != 0); &error(-2, "Bad module syntax. Only a-z, A-Z, 0-9, '_' are allowed for the name, with :: as package scoping separators") if($ARGV[0] =~ /[^\w:\.]/); local $@=0; eval 'require "'.$ARGV[0].'";'; if($@) { &error(1, "Failed include stage for '$ARGV[0]'. Error message:\n$@"); } else { # ... } print "$ARGV[0]: Valid\n"; sub error { &Common::error(@_); } #====================== #END MODULE VALIDATOR #====================== #### #===================== #BEGIN FOO::TRY #===================== package foo::try; use pm::Common; 1; #===================== #END FOO::TRY #===================== #### filc8166[559]% perl -I`pwd` ./bin/Module_Validator.pl foo::try Loading DB routines from perl5db.pl version 1.27 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. DB<1> s main::((eval 7)[./bin/Module_Validator.pl:16]:1): 1: require "foo::try"; main::(./bin/Module_Validator.pl:7): 7: DB<2> c (Module Validator) ERROR: Failed include stage for 'foo::try'. Error message: Can't locate foo::try in @INC (@INC contains: /nfs/fm/disks/fm_vt_n19029/users/gwcooper/vibe_regress /usr/intel/pkgs/perl/5.8.5/lib/5.8.5/i686-linux-64int /usr/intel/pkgs/perl/5.8.5/lib/5.8.5 /usr/intel/pkgs/perl/5.8.5/lib/site_perl/5.8.5/i686-linux-64int /usr/intel/pkgs/perl/5.8.5/lib/site_perl/5.8.5 /usr/intel/pkgs/perl/5.8.5/lib/site_perl .) at (eval 7)[./bin/Module_Validator.pl:16] line 1. Backtrace: at ./bin/Module_Validator.pl line 40 main::error(1, 'Failed include stage for \'foo::try\'. Error message:\x{a}Can\'t ...') called at ./bin/Module_Validator.pl line 19 Debugged program terminated. Use q to quit or R to restart, use O inhibit_exit to avoid stopping after program termination, h q, h R or h O to get additional info. DB<2> q filc8166[560]% pwd /nfs/fm/disks/fm_vt_n19029/users/gwcooper/vibe_regress filc8166[561]% ls foo/ try.pm