← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Tue Nov 7 05:38:10 2017
Reported on Tue Nov 7 06:16:04 2017

Filename/usr/local/lib/perl5/site_perl/mach/5.24/Razor2/Preproc/deHTML_comment.pm
StatementsExecuted 1 statements in 6µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sRazor2::Preproc::deHTML_comment::::doitRazor2::Preproc::deHTML_comment::doit
0000s0sRazor2::Preproc::deHTML_comment::::isitRazor2::Preproc::deHTML_comment::isit
0000s0sRazor2::Preproc::deHTML_comment::::newRazor2::Preproc::deHTML_comment::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Razor2::Preproc::deHTML_comment;
2
3
4sub new {
5
6 my $class = shift;
7 return bless {}, $class;
8
9}
10
11
12sub isit {
13
14 my ($self, $text) = @_;
15 my $isit = 0;
16 my ($hdr, $body) = split /\n\r*\n/, $$text, 2;
17
18 return 0 unless $body;
19
20 $isit = $body =~ /(?:<HTML>|<BODY|<FONT|<A HREF)/ism;
21 return $isit if $isit;
22
23 $isit = $hdr =~ m"^Content-Type: text/html"ism;
24 return $isit;
25
26}
27
28
29sub doit {
30
31 my ($self, $text) = @_;
32 my ($hdr, $body) = split /\n\r*\n/, $$text, 2;
33
34 $body =~ s/<!--.*?-->//gs;
35
36 $$text = "$hdr\n\n$body";
37
38}
39
40
4116µs1;
42