in reply to Re^6: error for undefined function that's been imported
in thread error for undefined function that's been imported

No, my discussion was dealing with the case of multiple "package" statements in one .pm file. The code you cite won't get an undefined sub but will pick up Bellman::foo. Sorry if this wasn't clear.

Now, since that's how I've been operating, and it seems that's not going to be possible (which I'll accept), what's the next best thing? what sort of coding styles might I adopt to alleviate this problem and still have my code look elegant and easy to read/edit by others?

Consider an object orientated approach. This avoids package namespace problems, as objects carry their own class (namespace) with them. see perlboot perltoot and perlobj for more on this subject.

--

Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)

  • Comment on Re^7: error for undefined function that's been imported

Replies are listed 'Best First'.
Re^8: error for undefined function that's been imported
by argv (Pilgrim) on Aug 17, 2005 at 07:24 UTC

    So, let me embarrassingly get back to basics for a sec. I'm pretty familiar with oo programming, but none of that applies to anything I'm doing in this particular project. The issue I'm dealing with is simply that I have a bunch of different functions separated (into different files) based on the nature of their purpose. In other words, I'm creating what I'd like to call a bunch of libraries of functions (and exported variables), not a bunch of objects and classes. I chose to implement these libraries in the form of Packages because I figured that would be efficient for perl and yield better execution performance for the apps that call them. But, given what I'm running into, I think I've chosen the wrong approach.

    So, since I don't need classes or objects, but I do need to create libraries, what's a more appropriate approach using perl?