Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: error for undefined function that's been imported

by argv (Pilgrim)
on Aug 18, 2005 at 17:06 UTC ( [id://484879]=note: print w/replies, xml ) Need Help??


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

The main point of creating modules is to encapsulate things that are logically independent of other things. Having mutual dependencies among modules just defeats their purpose.

While this is true, it's simplistic to think that just because something is encapsulated into its own module that it doesn't somehow rely on other modules that do entirely different things. This is the whole spirit of libraries, as opposed to objects and classes.

I'm sure I don't have to remind most of the readers here that there's nothing wrong or unusual about library functions that may call back and forth between themselves, nor is it always the case that one needs to build class hierarhcies just to have a series of independent functions that have no common ancestors to one another, but which are still separated into discrete files from one another because their abstraction paradigms are entirely different. While I'm a fan (and implementor) of object-oriented programming (I've written two books on the subject for ORA), I also know when not to use an elephant gun when all I want to kill is a mouse.

Surely, there must be a way in perl to have a series of modules that have variables and functions that can be exported and used by other modules, while also being able to import such from other modules, all without having the kind of mess I'm running into here. Given these set-backs, I can only assume that, perhaps, "use" and "module" are not the way to make generically exportable and inter-dependent library functions, but that some other method is perhaps more suited. Either that, or perl needs a way for a module to declare a function as type "no-really-I'm-global-and-this-time-I-mean-it."

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://484879]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-23 11:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found