in reply to Re: feedback on successful module loading
in thread feedback on successful module loading

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" }

Replies are listed 'Best First'.
Re^3: feedback on successful module loading
by ggg (Scribe) on Oct 08, 2004 at 05:17 UTC
    I was going to work on putting the module names into a DATA file and building the working script with another script. The result would have been just as long, but I wouldn't have written it by hand. I like your idea better. It has class!
    ggg