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 )
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
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 executionIts 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.
... let the deep links from the following explain Re: Cron revisited/Re^2: Perl Module Not Working In Crontab explain, and here they are:
- Perl/UNIX .profile problem
- Unix Aliases?
- Perl Script Not Working With Crontab
- Twig in a crontab?
- Running Perl program w/root privs via cron
- system call in crontab
- Perl & cron job environmental variables
- HowTo: Add Jobs To cron Under Linux or UNIX?
- Unix FAQ - Cron
- Unix FAQ - Cron
Cron jobs do not inherit the login environment of the user
Cron jobs do not have a stdin associated with them
... - Cron Frequently Asked Questions
- Cron Job FAQ
- Basic Linux Operations FAQ
- Automating Tasks with Cron and Crontab files
- 4.4. Scheduling processes
- system command is not working
- I have some problem with Crontab
- perl file doesn't execute
- script fails loading module version, but > version is installed
- CGI Help Guide , Troubleshooting Perl CGI scripts
- Csh Programming Considered Harmful
- How do I set env. Variables from Perl with shell script
- Get default login environment
- Set shell environment variables from within a perl script
- How to change a script's environment after the script is already run, based on shell sourcing ?
- Perl: Source shell script to for environment variables?
- Reading and setting the environment from a shell script for the calling program
- Importing environment variables from shell script file to Perl
- sourcing a shell script/.profile and importing into %ENV
- setting perl ENV from file
- Changing parent process environment variable
- Re^3: DBD::mysql fail install check (DYLD_LIBRARY_PATH ldd otool install_name_tool VERSIONER_PERL_PREFER_32_BIT .bundle/.dylib/.so
- Making a system command work via a scheduled task.
- How to troubleshoot scheduled tasks in Windows XP and in Windows Server 2003
- Re^6: pp and multiple perl scripts
- Basic debugging checklist , brian's Guide to Solving Any Perl Problem