in reply to Re: @ISA vs. base
in thread @ISA vs. base

I'm not sure I get this. I tend to go the other way: I use every single module I can, unless it doesn't work for my scenario. The advantage is that as they add new features, functionality, and speed, I get them for free.

For example, rather than about five lines of code to copy a file, I use File::Copy and use its copy function. That way, on platforms where there is a system copy, I get that faster copy for free. Attributes are copied. All those bonus functionalities are handled for free. I only don't use File::Copy where it doesn't work - as in string refs.

I don't, offhand, know of any scenario where base doesn't work, although I'm sure tye will enlighten me ;-), so I continue to use it as a preference over all others until then.

Replies are listed 'Best First'.
Re^3: @ISA vs. base
by siracusa (Friar) on Jul 25, 2005 at 18:45 UTC

    Don't get me wrong, I'm all for using modules. It's just that base.pm is a bit of a special case in that, when I see it at least, I immediately think that the package from which it's "use"d also uses fields.pm.

    If base.pm was just syntactic sugar for pushing onto @ISA, I'd be more inclined to use it. But its usage seems (to me anyway) to imply that fields.pm is also in the mix. Even if it's not, there's no way to tell from the "use base" line alone.

    I tend not to "use base" so no one will erroneously suspect that I'm using fields.pm and (probably more importantly) to avoid implying that one needs to "use base" if in order to subclass my class cleanly.

      I use "base" all the time, and I've never used "fields" for anything, so it seems it depends a lot on the point of view... At least I learned something today, as I didn't know that "base" interacted with "fields".