Recommendations on method parameter checkers

[email protected] (Stephen Adkins)
Newsgroups perl.p5ee
Message-ID <[email protected]>
Hi,

I am working on the debugging infrastructure of P5EEx::Blue.

I remember some discussion about modules in the Attribute::* namespace,
and I am seeking recommendations and guidance, as I am unfamiliar
with any of them.

I am inclined to add something like the following style of debug 
statements to my methods.

sub foo {
    P5EEx::Blue->dbgentry(@_) if ($P5EEx::Blue::DEBUG);
    my ($self, $param1, ...) = @_;
    ...
    P5EEx::Blue->dbgexit(@returnvals) if ($P5EEx::Blue::DEBUG);
    return(@returnvals);
}

This will allow me to produce debug output of entries and exits to methods
and traces of the parameters which are passed and values returned.
However, if I'm doing this, there are all kinds of great things about
checking PRECONDITIONS and POSTCONDITIONS that I could do.

Does anyone have recommendations about which existing modules are 
best for this?  My requirements are:

  1. Low runtime overhead (at least if "turned off")
  2. Runs in Perl 5.5.3
  3. In step with the future directions of Perl

I understand that #2 and #3 are perhaps at odds.
I am interested in understanding the 5.6.X-only options and what they
provide as well as the 5.5.3-compatible options.

Stephen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.