filmo has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I've got two programs, lets say "main.cgi" and "commons.pl". The "commons.pl" program contains all of the globably declared variables and subroutines that are used by all the other various programs, including "main.cgi".
In the commons file, I also have my "use" statements.
From the "main" program, I'm accessing this large group of subroutine and variable by using:#!/usr/bin/perl use DBI; use Date::Calc qw( Decode_Date_US Add_Delta_Days); use File::Copy; use LWP::Simple; use CGI::Carp 'fatalsToBrowser'; use CGI qw/:standard/; $q = new CGI; my $variables; etc...
Now, the problem is that I'm getting "Prototype mismatch: sub main::head ($) vs none at /usr/local/lib/perl5/5.00502/CGI.pm line 232." errors everytime I run the script.#!/usr/bin/perl require ("commons.pl"); rest of program here...
I've tried to define the "commons" as a .pm and "use commons", but then I get errors like "Undefined subroutine CGI::"
So, the question is how do I create a package of common variables, arrays, hashes, and subroutines in one file that I can call either through require or use and have them available to all my other programs.
--
Filmo the Klown
|
---|
Replies are listed 'Best First'. | |
---|---|
(bbfu) Re: Prototype mismatch error
by bbfu (Curate) on Jul 03, 2001 at 12:12 UTC | |
Re: Prototype mismatch error
by Zaxo (Archbishop) on Jul 03, 2001 at 05:37 UTC |
Back to
Seekers of Perl Wisdom