Skip to content

Commit

Permalink
Capture the PID from the filename properly.
Browse files Browse the repository at this point in the history
TODO: refactor this more cleanly, I don't like it.
  • Loading branch information
bigpresh committed Jul 23, 2011
1 parent 1f756e2 commit f6d444a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Dancer/Plugin/NYTProf.pm
Expand Up @@ -96,8 +96,11 @@ LISTSTART
my $label = $file;
$label =~ s{nytprof\.out\.}{};
$label =~ s{_}{/}g;
$label =~ s{\.(\d+)$}{};
my $pid = $1; # refactor this crap
my $created = scalar localtime( (stat $fullfilepath)->ctime );
$html .= qq{<li><a href="/nytprof/$file">$label</a> ($created)</li>};
$html .= qq{<li><a href="/nytprof/$file">$label</a>}
. qq{ (PID $pid, $created)</li>};
}

$html .= <<LISTEND;
Expand Down

0 comments on commit f6d444a

Please sign in to comment.