in reply to Re: Perl aesthetics: the good, the bad, the ugly.
in thread Perl aesthetics: the good, the bad, the ugly.

This is why you always have a param checking sub that you turn off unless $ENV{DEBUG} or something is true. There's plenty of examples of this type if thing on CPAN.
  • Comment on Re: Re: Perl aesthetics: the good, the bad, the ugly.

Replies are listed 'Best First'.
Re: Re: Re: Perl aesthetics: the good, the bad, the ugly.
by chromatic (Archbishop) on May 01, 2002 at 22:39 UTC
    Do these check that all uses of the param hash use the right keys? What you describe sounds to me like a sub that's called when populating the hash from @_ -- that's a good idea, but it's still not strict enough. I've come across code that uses 'style' in one place and 'stytle' in others.

    Clamped, read-only, psuedo-, or tied-hashes can fix this, but they're probably rare in production code.

    I wouldn't mind this convenience occasionally...