1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
package MyNote;
use strict;
use warnings;
require Exporter;
require UUID;
use vars qw(@EXPORT);
@EXPORT = qw(note);
sub import {
goto &Exporter::import;
}
my $realnode = UUID::_realnode();
substr $realnode, 0, 24, '' if $realnode;
# Yes, this clobbers Test::More::note,
# which is somewhat broken on Win32.
sub note {
my $work = join '', map { defined($_) ? $_ : '<UNDEF>' } @_;
chomp $work;
# hide the real node anywhere it appears.
$work =~ s/$realnode/XXXXXXXXXXXX/ig
if $realnode;
print '# ', $work, "\n";
}
1;
|