devnul has asked for the wisdom of the Perl Monks concerning the following question:
packageB.pm:package PackageA; require "libraries/somelib.pl"; ... variables, functions, etc 1;
.. Now I want to use both of these packages in a script:package PackageB; require "libraries/somelib.pl"; #NOTE: Same library as included in pac +kageA ... variables, functions, etc 1;
The problem is that the require in packageB never got executed. None of the functions or variables in somelib.pl exist within that namespace. Is there some reasonable solution to this problem? Again, I feel compelled to mention that the problem is far bigger then this small example I have show here. If the real world were this small I would just change somelib.pl into a module or something appropriate along those lines.#!/usr/bin/perl -w use strict; use PackageA; use PackageB;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl use and require enigma
by etcshadow (Priest) on Jun 16, 2004 at 23:21 UTC | |
|
Re: Perl use and require enigma
by Sidhekin (Priest) on Jun 16, 2004 at 22:21 UTC |