Mur has asked for the wisdom of the Perl Monks concerning the following question:
I just know I'm going to smack myself in the forehead when I get the answer to this, but I'm having a mental block today.
I'm making use of a CPAN package (DBIx::TextIndex as it happens, but it could be nearly any such package). Within the package the author has provided for extension to "your-favorite-RDBMS" by means of something like this:
My problem arises in that the rest of the package makes heavy use of "my" variables. Those variables are invisible to the code I provide in my "database".pm file, and in fact any use of them results in a 'Global symbol "%FOO" requires explicit package name'.my $db = 'DBIx/TextIndex/' . $args{db} . '.pm'; require "$db";
Must I prefix FOO with DBIx::TextIndex::, or is there another way? Should the author of the package used some other means of declaring variables, or is the require at fault?
-- | |||||||
|
| ||||||
...Nexcerpt...Connecting People With Expertise |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to override methods which use my() variables?
by adrianh (Chancellor) on Oct 30, 2002 at 16:36 UTC | |
by Mur (Pilgrim) on Nov 01, 2002 at 14:26 UTC | |
by adrianh (Chancellor) on Nov 01, 2002 at 18:05 UTC |
Back to
Seekers of Perl Wisdom