in reply to Re^3: Dynamically Changing Your Namespace
in thread Dynamically Changing Your Namespace

Not sure where you got that impression. My point was that those two modules were doing things that can be accomplished in plain Perl with a single, simple statement. Therefore using a module for these tasks actually *adds* complexity to your code.
  • Comment on Re^4: Dynamically Changing Your Namespace

Replies are listed 'Best First'.
Re^5: Dynamically Changing Your Namespace
by grinder (Bishop) on Mar 30, 2007 at 15:39 UTC
    using a module for these tasks actually *adds* complexity to your code

    Well, yes and no. It adds complexity and also adds insurance against bitrot. The price paid turns out to be a win if there was an unforseen set of circumstances that could cause the technique to fail, e.g. funky stuff involving lazy loading or what have you.

    With a module, the extra level of indirection gives you a chance to come up with a fix, safe in the knowledge that anything that uses it will inherit the improvement. Doing this in bare code means you have to go and hunt it down in the codebase if you ever need to fix it.

    • another intruder with the mooring in the heart of the Perl

Re^5: Dynamically Changing Your Namespace
by Moron (Curate) on Apr 02, 2007 at 14:46 UTC
    IMO: A subroutine represents a (update: re-usable) functional block and avoids duplication of its implementation. Size doesn't matter in that sense - i.e. other than it being an indication of efficient coding of the subroutine if it is optimally small

    (Update: I don't mean obsessively small as in golf - just not ten lines where one will do!)

    -M

    Free your mind