Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • .. but maybe you should even try to dump each ref in the argument list (untested):

    sub explain {
      return unless $ENV{TEST_VERBOSE};
      Test::More::diag(
        map{
          ref $_ ? do {
            require Data::Dumper;
            local $Data::Dumper::Indent   = 1;
            local $Data::Dumper::Sortkeys = 1;
            Data::Dumper::Dumper($_);
          } : $_
        } @_
      );
    }

    This would allow for nifty stuff like:

    my $self = Some::Object->new($id);
    explain 'I just created', $self;


    Cheers, Sebastian