Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: CGI script fails to execute in browser (how does @INC work)

by Anonymous Monk
on Oct 20, 2014 at 07:12 UTC ( #1104381=note: print w/replies, xml ) Need Help??


in reply to CGI script fails to execute in browser

lib::MyDatasource(which I have created)

What did you do? How? What error messages did you get?

Error messages explain everything :)

Basically you need to add

use lib '/absolute/path/to/where/you/installed/modules'; use MyDatasource; ...;

See lib, lib, lib, perlvar#@INC, perlrun#PERL5LIB, Re: -I flag being ignored and Simple Module Tutorial and even Re: package vs module? and Re: loop exits after printing the file, zentara package/module tutorial )

how does @INC work

You basically need work through the checklists (do what each item says, if it solves the problem GREAT, if it doesn't move on to NEXT item), brian's Guide to Solving Any Perl Problem, CGI Help Guide , Troubleshooting Perl CGI scripts ... More generic advice :) On debugging, verify everything, talk to teddybear ... checklists and more

Because https://httpd.apache.org/docs/2.2/howto/public_html.html#cgi / Apache Tutorial: Dynamic Content with CGI and more

Copy/paste from Re: To call a .pl file when a button is pressed on a GUI created using Perl CGI (webserver) for the links below

Its simple, you need a webserver

Why? Because webpages and CGI needs a webserver, thats how it works

Its weird that so many folks manage to create a GUI using Perl CGI without understanding this

learn about the internet,Web Programming: For Beginners, to get an overall picture of how the internet works, how tcp/ip, sockets, html, ajax, all fit together....

See also Mojolicious::Lite +and jQuery +AJAX + Mojo::Template

And a copy-pasta for you:)

Also, there are checklists for that , Basic debugging checklist , brian's Guide to Solving Any Perl Problem, CGI Help Guide , Troubleshooting Perl CGI scripts

Yes, work through these checklists, when you find a problem on the list, use a solution from the list, when you find a problem not on the list (rare), post the error message and problem description here

brian's Guide to Solving Any Perl Problem, CGI Help Guide , Troubleshooting Perl CGI scripts

So examine your server configuration and compare to https://httpd.apache.org/docs/2.2/howto/public_html.html#cgi / Apache Tutorial: Dynamic Content with CGI

learn about the internet,Web Programming: For Beginners, to get an overall picture of how the internet works, how tcp/ip, sockets, html, ajax, all fit together.

Explicitly using Options to permit CGI execution, Apache Tutorial: Dynamic Content with CGI - Apache HTTP Server Version 2.2 : Explicitly using Options to permit CGI execution

... let the deep links from the following explain Re: Cron revisited/Re^2: Perl Module Not Working In Crontab explain, and here they are:

Replies are listed 'Best First'.
Re^2: CGI script fails to execute in browser (how does @INC work)
by revendar (Novice) on Oct 21, 2014 at 06:43 UTC
    Thanks a lot. I will dig through all the links and will try to find the solution.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1104381]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2018-07-21 21:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (450 votes). Check out past polls.

    Notices?