Subject: | dprofpp craps out on tmon.out generated by Devel::Profiler |
Tried to use Devel::Profiler in profiling a new module from CPAN. The tmon.out file that was output caused dprofpp to choke as follows:
bash-2.04$ dprofpp -u tmon.out
Modification of non-creatable array value attempted, subscript -1 at /usr/bin/dprofpp line 584, <fh> line 57.
Perl 5.6.1, i686 linux, running a 2.4.2-2 kernel.
Using Devel::DProf on the code snippet below works.
The code, as follows (requires HTML::TagFilter)
#!/usr/bin/perl
use Devel::Profiler;
use HTML::TagFilter;
my %submits = (head => 'This is a <b>test of </b> head1',
title => 'title goes here <img src="img">',
desc => '<script>Script is a bug</script><br><p><a href="test" onclick="test">but href is ok - if there is no onclick</a><p>p is ok too, as is <b>bold</b> or <strong>strong</strong> and <i>italics</i> and <ul>underline</ul>.'
);
my %parsed = ();
my $tf = HTML::TagFilter->new(allow => {},
deny => {});
foreach $key (keys %submits) {
$tf->parse($submits{$key});
$parsed{$key} = $tf->output();
}
print "SUMMARY:\n\n";
foreach $k (keys %submits) {
print "OLD: $submits{$k}\n";
print "NEW: $parsed{$k}\n";
print "----\n";
}