Red Neckerson has asked for the wisdom of the Perl Monks concerning the following question:
package MYPACKAGE; use DBI; use CGI; [several sub routines follow] 1;
Do I "carry" modules DBI, CGI.PM, and their symbol tables, or others I name (their functions, routines, etc), into a script by merely declaring the MYPACKAGE.PM within it, as in:
#!/usr/bin/perl5 use MYPACKAGE.PM; print header;###from CGI.PM start_html(blah, blah, blah);###from CGI.PM MYPACKAGE::connect();###connecting to mySQL from a subroutine in MYPAC +KAGE.PM
Or do I have to re-state use DBI; use CGI.PM in the script? Red------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using a package within a package
by jepri (Parson) on May 24, 2001 at 19:24 UTC | |
|
Re: Using a package within a package
by blue_cowdawg (Monsignor) on May 24, 2001 at 19:25 UTC | |
|
Re: Using a package within a package
by Sifmole (Chaplain) on May 24, 2001 at 19:47 UTC | |
|
Re: Using a package within a package
by $code or die (Deacon) on May 24, 2001 at 19:37 UTC |