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.