in reply to Calling perl from CGI

I use a script to test for modules locally, and it includes the following lines:

require Class::Inspector; my $file = Class::Inspector->resolved_filename($ARGV[0]); unless ($file) { warn "not found\n"; exit (1); } print $file;

You can convert it into a CGI script easily.

The advantage is that it does not eval() or system() anything. And it does not really load the module. Some modules start their actions when you "use" or "require" or "-M" them, even if you don't call any of their functions. For some modules, these actions are pretty severe (like Acme::Bleach...). You won't have this problem with the above code.

Of course you need Class::Inspector for this.