Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Defining classes and inheritance using packages within a single .pl file, without creating modules

by jbert (Priest)
on Nov 29, 2006 at 12:06 UTC ( [id://586663]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Defining classes and inheritance using packages within a single .pl file, without creating modules
in thread Defining classes and inheritance using packages within a single .pl file, without creating modules

That's interesting - and serves as an additional data point that consensus on current perl OO "best practice" is a bit limited at the moment. Yes, TIMTOWDI, but that can be confusing for newcomers.

Do you think that these tutorials are still current? (Actually, I should have linked to these at first, sorry about that).

By the way, would you care to elaborate on base's failure modes? Since you've caused me to look more closely, I can see how it might hurt if you're defining a module inline with the same name as one available as a seperate file via require - is that the main issue?

  • Comment on Re^3: Defining classes and inheritance using packages within a single .pl file, without creating modules

Replies are listed 'Best First'.
Re^4: Defining classes and inheritance using packages within a single .pl file, without creating modules
by bart (Canon) on Nov 29, 2006 at 12:24 UTC
    I'm not sure how base has evolved over the years, but I've had problems where it died complaining it couldn't locate a module where the package was inline in the script further down, and it may indeed load an unwanted module of the same name (B is a favourite example) under similar circumstances. Fun for the whole family.

    Checking $VERSION in a package, to check if the package exists, is not the best way to tackle the problems, IMO.

      Don't blame base. If you're going to inline modules that use base, do it properly.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 22:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found