10 English - use nice English (or awk) names for ugly punctuation variables
15 use English qw( -no_match_vars ) ; # Avoids regex performance
16 # penalty in perl 5.16 and
19 if ($ERRNO =~ /denied/) { ... }
23 This module provides aliases for the built-in variables whose
24 names no one seems to like to read. Variables with side-effects
25 which get triggered just by accessing them (like $0) will still
28 For those variables that have an B<awk> version, both long
29 and short English alternatives are provided. For example,
30 the C<$/> variable can be referred to either $RS or
31 $INPUT_RECORD_SEPARATOR if you are using the English module.
33 See L<perlvar> for a complete list of these.
37 NOTE: This was fixed in perl 5.20. Mentioning these three variables no
38 longer makes a speed difference. This section still applies if your code
39 is to run on perl 5.18 or earlier.
41 This module can provoke sizeable inefficiencies for regular expressions,
42 due to unfortunate implementation details. If performance matters in
43 your application and you don't need $PREMATCH, $MATCH, or $POSTMATCH,
46 use English qw( -no_match_vars ) ;
48 . B<It is especially important to do this in modules to avoid penalizing
49 all applications which use them.>
57 # Grandfather $NAME import
60 my @list = grep { ! /^-no_match_vars$/ } @_ ;
61 local $Exporter::ExportLevel = 1;
63 *EXPORT = \@COMPLETE_EXPORT ;
73 Carp::croak("Can't create English for match leftovers: $@") ;
78 *EXPORT = \@MINIMAL_EXPORT ;
80 Exporter::import($this,grep {s/^\$/*/} @list);
88 *INPUT_RECORD_SEPARATOR
91 *OUTPUT_FIELD_SEPARATOR
93 *OUTPUT_RECORD_SEPARATOR
99 *FORMAT_LINES_PER_PAGE
103 *FORMAT_LINE_BREAK_CHARACTERS
133 *LAST_REGEXP_CODE_RESULT
134 *EXCEPTIONS_BEING_CAUGHT
135 *LAST_SUBMATCH_RESULT
147 @COMPLETE_EXPORT = ( @MINIMAL_EXPORT, @MATCH_EXPORT ) ;
149 # The ground of all being.
155 *LAST_PAREN_MATCH = *+ ;
156 *LAST_SUBMATCH_RESULT = *^N ;
157 *LAST_MATCH_START = *-{ARRAY} ;
158 *LAST_MATCH_END = *+{ARRAY} ;
162 *INPUT_LINE_NUMBER = *. ;
164 *INPUT_RECORD_SEPARATOR = */ ;
169 *OUTPUT_AUTOFLUSH = *| ;
170 *OUTPUT_FIELD_SEPARATOR = *, ;
172 *OUTPUT_RECORD_SEPARATOR = *\ ;
175 # Interpolation "constants".
177 *LIST_SEPARATOR = *" ;
178 *SUBSCRIPT_SEPARATOR = *; ;
183 *FORMAT_PAGE_NUMBER = *% ;
184 *FORMAT_LINES_PER_PAGE = *= ;
185 *FORMAT_LINES_LEFT = *- ;
187 *FORMAT_TOP_NAME = *^ ;
188 *FORMAT_LINE_BREAK_CHARACTERS = *: ;
189 *FORMAT_FORMFEED = *^L ;
198 *EXTENDED_OS_ERROR = *^E ;
207 *EFFECTIVE_USER_ID = *> ;
209 *REAL_GROUP_ID = *( ;
211 *EFFECTIVE_GROUP_ID = *) ;
217 *PERL_VERSION = *^V ;
218 *OLD_PERL_VERSION = *] ;
222 *SYSTEM_FD_MAX = *^F ;
223 *INPLACE_EDIT = *^I ;
225 *LAST_REGEXP_CODE_RESULT = *^R ;
226 *EXCEPTIONS_BEING_CAUGHT = *^S ;
229 *EXECUTABLE_NAME = *^X ;