You can make your code shorter by writing your code only once and putting your modules to test into a list.
#!/opt/bin/perl -w print "running $0 in Perl $]\n"; for ( qw( CGI HTML::Template ) ) { print eval "require $_" ? "$_ ok\n" : "$_ failed: $@\n" }
In reply to Re^2: feedback on successful module loading
by diotalevi
in thread feedback on successful module loading
by ggg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |