← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:10 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/5.18.2/English.pm
StatementsExecuted 367 statements in 1.25ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.13ms2.62msEnglish::::BEGIN@192English::BEGIN@192
424242653┬Ás16.6msEnglish::::importEnglish::import
111140┬Ás407┬ÁsEnglish::::BEGIN@153English::BEGIN@153
11114┬Ás23┬ÁsEnglish::::BEGIN@52English::BEGIN@52
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package English;
2
31600nsour $VERSION = '1.06_01';
4
51300nsrequire Exporter;
614┬Ás@ISA = qw(Exporter);
7
8=head1 NAME
9
10English - use nice English (or awk) names for ugly punctuation variables
11
12=head1 SYNOPSIS
13
14 use English;
15 use English qw( -no_match_vars ) ; # Avoids regex performance penalty
16 # in perl 5.16 and earlier
17 ...
18 if ($ERRNO =~ /denied/) { ... }
19
20=head1 DESCRIPTION
21
22This module provides aliases for the built-in variables whose
23names no one seems to like to read. Variables with side-effects
24which get triggered just by accessing them (like $0) will still
25be affected.
26
27For those variables that have an B<awk> version, both long
28and short English alternatives are provided. For example,
29the C<$/> variable can be referred to either $RS or
30$INPUT_RECORD_SEPARATOR if you are using the English module.
31
32See L<perlvar> for a complete list of these.
33
34=head1 PERFORMANCE
35
36NOTE: This was fixed in perl 5.20. Mentioning these three variables no
37longer makes a speed difference. This section still applies if your code
38is to run on perl 5.18 or earlier.
39
40This module can provoke sizeable inefficiencies for regular expressions,
41due to unfortunate implementation details. If performance matters in
42your application and you don't need $PREMATCH, $MATCH, or $POSTMATCH,
43try doing
44
45 use English qw( -no_match_vars ) ;
46
47. B<It is especially important to do this in modules to avoid penalizing
48all applications which use them.>
49
50=cut
51
522228┬Ás233┬Ás
# spent 23┬Ás (14+10) within English::BEGIN@52 which was called: # once (14┬Ás+10┬Ás) by Perl::Critic::Command::BEGIN@14 at line 52
no warnings;
# spent 23┬Ás making 1 call to English::BEGIN@52 # spent 10┬Ás making 1 call to warnings::unimport
53
541100nsmy $globbed_match ;
55
56# Grandfather $NAME import
57
# spent 16.6ms (653┬Ás+15.9) within English::import which was called 42 times, avg 394┬Ás/call: # once (19┬Ás+1.64ms) by Perl::Critic::Command::BEGIN@14 at line 14 of Perl/Critic/Command.pm # once (19┬Ás+429┬Ás) by Perl::Critic::Policy::Documentation::PodSpelling::BEGIN@14 at line 14 of Perl/Critic/Policy/Documentation/PodSpelling.pm # once (19┬Ás+410┬Ás) by Perl::Critic::Exception::Parse::BEGIN@14 at line 14 of Perl/Critic/Exception/Parse.pm # once (14┬Ás+402┬Ás) by Perl::Critic::Policy::RegularExpressions::ProhibitComplexRegexes::BEGIN@15 at line 15 of Perl/Critic/Policy/RegularExpressions/ProhibitComplexRegexes.pm # once (18┬Ás+383┬Ás) by Perl::Critic::Policy::Modules::ProhibitEvilModules::BEGIN@13 at line 13 of Perl/Critic/Policy/Modules/ProhibitEvilModules.pm # once (27┬Ás+374┬Ás) by Perl::Critic::Statistics::BEGIN@14 at line 14 of Perl/Critic/Statistics.pm # once (18┬Ás+376┬Ás) by Perl::Critic::Policy::Documentation::RequirePackageMatchesPodName::BEGIN@16 at line 16 of Perl/Critic/Policy/Documentation/RequirePackageMatchesPodName.pm # once (16┬Ás+373┬Ás) by Perl::Critic::Policy::Variables::ProhibitEvilVariables::BEGIN@13 at line 13 of Perl/Critic/Policy/Variables/ProhibitEvilVariables.pm # once (15┬Ás+373┬Ás) by Perl::Critic::Policy::ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions::BEGIN@13 at line 13 of Perl/Critic/Policy/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.pm # once (14┬Ás+373┬Ás) by Perl::Critic::UserProfile::BEGIN@14 at line 14 of Perl/Critic/UserProfile.pm # once (17┬Ás+368┬Ás) by Perl::Critic::Policy::Subroutines::ProhibitManyArgs::BEGIN@18 at line 18 of Perl/Critic/Policy/Subroutines/ProhibitManyArgs.pm # once (15┬Ás+368┬Ás) by Perl::Critic::Policy::CodeLayout::RequireConsistentNewlines::BEGIN@17 at line 17 of Perl/Critic/Policy/CodeLayout/RequireConsistentNewlines.pm # once (14┬Ás+367┬Ás) by Perl::Critic::Policy::RegularExpressions::ProhibitEnumeratedClasses::BEGIN@15 at line 15 of Perl/Critic/Policy/RegularExpressions/ProhibitEnumeratedClasses.pm # once (15┬Ás+366┬Ás) by Perl::Critic::Policy::ValuesAndExpressions::ProhibitComplexVersion::BEGIN@15 at line 15 of Perl/Critic/Policy/ValuesAndExpressions/ProhibitComplexVersion.pm # once (14┬Ás+366┬Ás) by Perl::Critic::Policy::CodeLayout::RequireTidyCode::BEGIN@14 at line 14 of Perl/Critic/Policy/CodeLayout/RequireTidyCode.pm # once (15┬Ás+361┬Ás) by Perl::Critic::Policy::ValuesAndExpressions::RequireConstantVersion::BEGIN@15 at line 15 of Perl/Critic/Policy/ValuesAndExpressions/RequireConstantVersion.pm # once (15┬Ás+360┬Ás) by Perl::Critic::BEGIN@14 at line 14 of Perl/Critic.pm # once (14┬Ás+361┬Ás) by Perl::Critic::Policy::Documentation::RequirePodLinksIncludeText::BEGIN@16 at line 16 of Perl/Critic/Policy/Documentation/RequirePodLinksIncludeText.pm # once (15┬Ás+355┬Ás) by Perl::Critic::Annotation::BEGIN@15 at line 15 of Perl/Critic/Annotation.pm # once (14┬Ás+356┬Ás) by Perl::Critic::Policy::CodeLayout::ProhibitTrailingWhitespace::BEGIN@13 at line 13 of Perl/Critic/Policy/CodeLayout/ProhibitTrailingWhitespace.pm # once (14┬Ás+356┬Ás) by Perl::Critic::Policy::Subroutines::RequireArgUnpacking::BEGIN@15 at line 15 of Perl/Critic/Policy/Subroutines/RequireArgUnpacking.pm # once (14┬Ás+355┬Ás) by Perl::Critic::Policy::RegularExpressions::ProhibitSingleCharAlternation::BEGIN@15 at line 15 of Perl/Critic/Policy/RegularExpressions/ProhibitSingleCharAlternation.pm # once (14┬Ás+355┬Ás) by Perl::Critic::Policy::RegularExpressions::ProhibitUnusedCapture::BEGIN@15 at line 15 of Perl/Critic/Policy/RegularExpressions/ProhibitUnusedCapture.pm # once (14┬Ás+354┬Ás) by Perl::Critic::Policy::RegularExpressions::ProhibitUnusualDelimiters::BEGIN@15 at line 15 of Perl/Critic/Policy/RegularExpressions/ProhibitUnusualDelimiters.pm # once (15┬Ás+353┬Ás) by Perl::Critic::OptionsProcessor::BEGIN@14 at line 14 of Perl/Critic/OptionsProcessor.pm # once (14┬Ás+354┬Ás) by Perl::Critic::Policy::RegularExpressions::ProhibitFixedStringMatches::BEGIN@15 at line 15 of Perl/Critic/Policy/RegularExpressions/ProhibitFixedStringMatches.pm # once (14┬Ás+353┬Ás) by Perl::Critic::Policy::Objects::ProhibitIndirectSyntax::BEGIN@15 at line 15 of Perl/Critic/Policy/Objects/ProhibitIndirectSyntax.pm # once (17┬Ás+349┬Ás) by Perl::Critic::Theme::BEGIN@13 at line 13 of Perl/Critic/Theme.pm # once (14┬Ás+351┬Ás) by Perl::Critic::Policy::RegularExpressions::ProhibitEscapedMetacharacters::BEGIN@14 at line 14 of Perl/Critic/Policy/RegularExpressions/ProhibitEscapedMetacharacters.pm # once (14┬Ás+350┬Ás) by Perl::Critic::Policy::RegularExpressions::RequireBracesForMultiline::BEGIN@15 at line 15 of Perl/Critic/Policy/RegularExpressions/RequireBracesForMultiline.pm # once (17┬Ás+343┬Ás) by Perl::Critic::Violation::BEGIN@14 at line 14 of Perl/Critic/Violation.pm # once (14┬Ás+346┬Ás) by Perl::Critic::Policy::Variables::ProhibitPunctuationVars::BEGIN@14 at line 14 of Perl/Critic/Policy/Variables/ProhibitPunctuationVars.pm # once (14┬Ás+345┬Ás) by Perl::Critic::Policy::NamingConventions::Capitalization::BEGIN@14 at line 14 of Perl/Critic/Policy/NamingConventions/Capitalization.pm # once (14┬Ás+345┬Ás) by Perl::Critic::Exception::AggregateConfiguration::BEGIN@15 at line 15 of Perl/Critic/Exception/AggregateConfiguration.pm # once (15┬Ás+341┬Ás) by Perl::Critic::Utils::POD::BEGIN@14 at line 14 of Perl/Critic/Utils/POD.pm # once (16┬Ás+339┬Ás) by Perl::Critic::Policy::BEGIN@14 at line 14 of Perl/Critic/Policy.pm # once (14┬Ás+338┬Ás) by Perl::Critic::Config::BEGIN@14 at line 14 of Perl/Critic/Config.pm # once (14┬Ás+335┬Ás) by Perl::Critic::Utils::BEGIN@19 at line 19 of Perl/Critic/Utils.pm # once (14┬Ás+335┬Ás) by Perl::Critic::PolicyFactory::BEGIN@14 at line 14 of Perl/Critic/PolicyFactory.pm # once (14┬Ás+334┬Ás) by Perl::Critic::Exception::IO::BEGIN@15 at line 15 of Perl/Critic/Exception/IO.pm # once (21┬Ás+159┬Ás) by Perl::Critic::Policy::Subroutines::ProhibitUnusedPrivateSubroutines::BEGIN@15 at line 15 of Perl/Critic/Policy/Subroutines/ProhibitUnusedPrivateSubroutines.pm # once (14┬Ás+58┬Ás) by Perl::Critic::Policy::Subroutines::ProtectPrivateSubs::BEGIN@15 at line 15 of Perl/Critic/Policy/Subroutines/ProtectPrivateSubs.pm
sub import {
584217┬Ás my $this = shift;
5986262┬Ás4465┬Ás my @list = grep { ! /^-no_match_vars$/ } @_ ;
# spent 65┬Ás making 44 calls to English::CORE:match, avg 1┬Ás/call
604214┬Ás local $Exporter::ExportLevel = 1;
614231┬Ás if ( @_ == @list ) {
62 *EXPORT = \@COMPLETE_EXPORT ;
63 $globbed_match ||= (
64 eval q{
65 *MATCH = *& ;
66 *PREMATCH = *` ;
67 *POSTMATCH = *' ;
68 1 ;
69 }
70 || do {
71 require Carp ;
72 Carp::croak("Can't create English for match leftovers: $@") ;
73 }
74 ) ;
75 }
76 else {
774221┬Ás *EXPORT = \@MINIMAL_EXPORT ;
78 }
7944215┬Ás4415.8ms Exporter::import($this,grep {s/^\$/*/} @list);
# spent 15.8ms making 42 calls to Exporter::import, avg 377┬Ás/call # spent 2┬Ás making 2 calls to English::CORE:subst, avg 1┬Ás/call
80}
81
82110┬Ás@MINIMAL_EXPORT = qw(
83 *ARG
84 *LAST_PAREN_MATCH
85 *INPUT_LINE_NUMBER
86 *NR
87 *INPUT_RECORD_SEPARATOR
88 *RS
89 *OUTPUT_AUTOFLUSH
90 *OUTPUT_FIELD_SEPARATOR
91 *OFS
92 *OUTPUT_RECORD_SEPARATOR
93 *ORS
94 *LIST_SEPARATOR
95 *SUBSCRIPT_SEPARATOR
96 *SUBSEP
97 *FORMAT_PAGE_NUMBER
98 *FORMAT_LINES_PER_PAGE
99 *FORMAT_LINES_LEFT
100 *FORMAT_NAME
101 *FORMAT_TOP_NAME
102 *FORMAT_LINE_BREAK_CHARACTERS
103 *FORMAT_FORMFEED
104 *CHILD_ERROR
105 *OS_ERROR
106 *ERRNO
107 *EXTENDED_OS_ERROR
108 *EVAL_ERROR
109 *PROCESS_ID
110 *PID
111 *REAL_USER_ID
112 *UID
113 *EFFECTIVE_USER_ID
114 *EUID
115 *REAL_GROUP_ID
116 *GID
117 *EFFECTIVE_GROUP_ID
118 *EGID
119 *PROGRAM_NAME
120 *PERL_VERSION
121 *ACCUMULATOR
122 *COMPILING
123 *DEBUGGING
124 *SYSTEM_FD_MAX
125 *INPLACE_EDIT
126 *PERLDB
127 *BASETIME
128 *WARNING
129 *EXECUTABLE_NAME
130 *OSNAME
131 *LAST_REGEXP_CODE_RESULT
132 *EXCEPTIONS_BEING_CAUGHT
133 *LAST_SUBMATCH_RESULT
134 @LAST_MATCH_START
135 @LAST_MATCH_END
136);
137
138
1391500ns@MATCH_EXPORT = qw(
140 *MATCH
141 *PREMATCH
142 *POSTMATCH
143);
144
14517┬Ás@COMPLETE_EXPORT = ( @MINIMAL_EXPORT, @MATCH_EXPORT ) ;
146
147# The ground of all being.
148
1491600ns *ARG = *_ ;
150
151# Matching.
152
1533210┬Ás1407┬Ás
# spent 407┬Ás (140+267) within English::BEGIN@153 which was called: # once (140┬Ás+267┬Ás) by Perl::Critic::Command::BEGIN@14 at line 153
*LAST_PAREN_MATCH = *+ ;
# spent 407┬Ás making 1 call to English::BEGIN@153
1541200ns *LAST_SUBMATCH_RESULT = *^N ;
1551800ns *LAST_MATCH_START = *-{ARRAY} ;
1561100ns *LAST_MATCH_END = *+{ARRAY} ;
157
158# Input.
159
1601200ns *INPUT_LINE_NUMBER = *. ;
1611200ns *NR = *. ;
1621200ns *INPUT_RECORD_SEPARATOR = */ ;
1631200ns *RS = */ ;
164
165# Output.
166
1671200ns *OUTPUT_AUTOFLUSH = *| ;
1681200ns *OUTPUT_FIELD_SEPARATOR = *, ;
1691300ns *OFS = *, ;
1701100ns *OUTPUT_RECORD_SEPARATOR = *\ ;
1711200ns *ORS = *\ ;
172
173# Interpolation "constants".
174
1751200ns *LIST_SEPARATOR = *" ;
1761200ns *SUBSCRIPT_SEPARATOR = *; ;
1771200ns *SUBSEP = *; ;
178
179# Formats
180
1811200ns *FORMAT_PAGE_NUMBER = *% ;
1821200ns *FORMAT_LINES_PER_PAGE = *= ;
1831100ns *FORMAT_LINES_LEFT = *- ;
1841100ns *FORMAT_NAME = *~ ;
1851200ns *FORMAT_TOP_NAME = *^ ;
1861100ns *FORMAT_LINE_BREAK_CHARACTERS = *: ;
1871100ns *FORMAT_FORMFEED = *^L ;
188
189# Error status.
190
1911100ns *CHILD_ERROR = *? ;
1923206┬Ás12.62ms
# spent 2.62ms (1.13+1.49) within English::BEGIN@192 which was called: # once (1.13ms+1.49ms) by Perl::Critic::Command::BEGIN@14 at line 192
*OS_ERROR = *! ;
# spent 2.62ms making 1 call to English::BEGIN@192
1931200ns *ERRNO = *! ;
1941100ns *OS_ERROR = *! ;
1951100ns *ERRNO = *! ;
1961200ns *EXTENDED_OS_ERROR = *^E ;
1971100ns *EVAL_ERROR = *@ ;
198
199# Process info.
200
2011200ns *PROCESS_ID = *$ ;
2021200ns *PID = *$ ;
2031100ns *REAL_USER_ID = *< ;
2041200ns *UID = *< ;
2051100ns *EFFECTIVE_USER_ID = *> ;
2061100ns *EUID = *> ;
2071100ns *REAL_GROUP_ID = *( ;
2081100ns *GID = *( ;
2091100ns *EFFECTIVE_GROUP_ID = *) ;
2101200ns *EGID = *) ;
2111200ns *PROGRAM_NAME = *0 ;
212
213# Internals.
214
2151200ns *PERL_VERSION = *^V ;
2161100ns *ACCUMULATOR = *^A ;
2171100ns *COMPILING = *^C ;
2181100ns *DEBUGGING = *^D ;
2191100ns *SYSTEM_FD_MAX = *^F ;
2201100ns *INPLACE_EDIT = *^I ;
2211100ns *PERLDB = *^P ;
2221100ns *LAST_REGEXP_CODE_RESULT = *^R ;
2231100ns *EXCEPTIONS_BEING_CAUGHT = *^S ;
2241100ns *BASETIME = *^T ;
2251200ns *WARNING = *^W ;
2261100ns *EXECUTABLE_NAME = *^X ;
2271200ns *OSNAME = *^O ;
228
229# Deprecated.
230
231# *ARRAY_BASE = *[ ;
232# *OFMT = *# ;
233# *OLD_PERL_VERSION = *] ;
234
235114┬Ás1;