Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Calling perl from CGI

by betterworld (Curate)
on Sep 07, 2008 at 09:29 UTC ( [id://709626]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://709626]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2026-01-16 00:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.