source: trunk/third/perl/lib/English.pm @ 14545

Revision 14545, 3.5 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14544, which included commits to RCS files with non-trunk default branches.
Line 
1package English;
2
3require Exporter;
4@ISA = (Exporter);
5
6=head1 NAME
7
8English - use nice English (or awk) names for ugly punctuation variables
9
10=head1 SYNOPSIS
11
12    use English;
13    ...
14    if ($ERRNO =~ /denied/) { ... }
15
16=head1 DESCRIPTION
17
18This module provides aliases for the built-in variables whose
19names no one seems to like to read.  Variables with side-effects
20which get triggered just by accessing them (like $0) will still
21be affected.
22
23For those variables that have an B<awk> version, both long
24and short English alternatives are provided.  For example,
25the C<$/> variable can be referred to either $RS or
26$INPUT_RECORD_SEPARATOR if you are using the English module.
27
28See L<perlvar> for a complete list of these.
29
30=head1 BUGS
31
32This module provokes sizeable inefficiencies for regular expressions,
33due to unfortunate implementation details.  If performance matters,
34consider avoiding English.
35
36=cut
37
38no warnings;
39
40# Grandfather $NAME import
41sub import {
42    my $this = shift;
43    my @list = @_;
44    local $Exporter::ExportLevel = 1;
45    Exporter::import($this,grep {s/^\$/*/} @list);
46}
47
48@EXPORT = qw(
49        *ARG
50        *MATCH
51        *PREMATCH
52        *POSTMATCH
53        *LAST_PAREN_MATCH
54        *INPUT_LINE_NUMBER
55        *NR
56        *INPUT_RECORD_SEPARATOR
57        *RS
58        *OUTPUT_AUTOFLUSH
59        *OUTPUT_FIELD_SEPARATOR
60        *OFS
61        *OUTPUT_RECORD_SEPARATOR
62        *ORS
63        *LIST_SEPARATOR
64        *SUBSCRIPT_SEPARATOR
65        *SUBSEP
66        *FORMAT_PAGE_NUMBER
67        *FORMAT_LINES_PER_PAGE
68        *FORMAT_LINES_LEFT
69        *FORMAT_NAME
70        *FORMAT_TOP_NAME
71        *FORMAT_LINE_BREAK_CHARACTERS
72        *FORMAT_FORMFEED
73        *CHILD_ERROR
74        *OS_ERROR
75        *ERRNO
76        *EXTENDED_OS_ERROR
77        *EVAL_ERROR
78        *PROCESS_ID
79        *PID
80        *REAL_USER_ID
81        *UID
82        *EFFECTIVE_USER_ID
83        *EUID
84        *REAL_GROUP_ID
85        *GID
86        *EFFECTIVE_GROUP_ID
87        *EGID
88        *PROGRAM_NAME
89        *PERL_VERSION
90        *ACCUMULATOR
91        *DEBUGGING
92        *SYSTEM_FD_MAX
93        *INPLACE_EDIT
94        *PERLDB
95        *BASETIME
96        *WARNING
97        *EXECUTABLE_NAME
98        *OSNAME
99        *LAST_REGEXP_CODE_RESULT
100        *EXCEPTIONS_BEING_CAUGHT
101);
102
103# The ground of all being. @ARG is deprecated (5.005 makes @_ lexical)
104
105        *ARG                                    = *_    ;
106
107# Matching.
108
109        *MATCH                                  = *&    ;
110        *PREMATCH                               = *`    ;
111        *POSTMATCH                              = *'    ;
112        *LAST_PAREN_MATCH                       = *+    ;
113
114# Input.
115
116        *INPUT_LINE_NUMBER                      = *.    ;
117            *NR                                 = *.    ;
118        *INPUT_RECORD_SEPARATOR                 = */    ;
119            *RS                                 = */    ;
120
121# Output.
122
123        *OUTPUT_AUTOFLUSH                       = *|    ;
124        *OUTPUT_FIELD_SEPARATOR                 = *,    ;
125            *OFS                                = *,    ;
126        *OUTPUT_RECORD_SEPARATOR                = *\    ;
127            *ORS                                = *\    ;
128
129# Interpolation "constants".
130
131        *LIST_SEPARATOR                         = *"    ;
132        *SUBSCRIPT_SEPARATOR                    = *;    ;
133            *SUBSEP                             = *;    ;
134
135# Formats
136
137        *FORMAT_PAGE_NUMBER                     = *%    ;
138        *FORMAT_LINES_PER_PAGE                  = *=    ;
139        *FORMAT_LINES_LEFT                      = *-    ;
140        *FORMAT_NAME                            = *~    ;
141        *FORMAT_TOP_NAME                        = *^    ;
142        *FORMAT_LINE_BREAK_CHARACTERS           = *:    ;
143        *FORMAT_FORMFEED                        = *^L   ;
144
145# Error status.
146
147        *CHILD_ERROR                            = *?    ;
148        *OS_ERROR                               = *!    ;
149            *ERRNO                              = *!    ;
150        *EXTENDED_OS_ERROR                      = *^E   ;
151        *EVAL_ERROR                             = *@    ;
152
153# Process info.
154
155        *PROCESS_ID                             = *$    ;
156            *PID                                = *$    ;
157        *REAL_USER_ID                           = *<    ;
158            *UID                                = *<    ;
159        *EFFECTIVE_USER_ID                      = *>    ;
160            *EUID                               = *>    ;
161        *REAL_GROUP_ID                          = *(    ;
162            *GID                                = *(    ;
163        *EFFECTIVE_GROUP_ID                     = *)    ;
164            *EGID                               = *)    ;
165        *PROGRAM_NAME                           = *0    ;
166
167# Internals.
168
169        *PERL_VERSION                           = *^V   ;
170        *ACCUMULATOR                            = *^A   ;
171        *COMPILING                              = *^C   ;
172        *DEBUGGING                              = *^D   ;
173        *SYSTEM_FD_MAX                          = *^F   ;
174        *INPLACE_EDIT                           = *^I   ;
175        *PERLDB                                 = *^P   ;
176        *LAST_REGEXP_CODE_RESULT                = *^R   ;
177        *EXCEPTIONS_BEING_CAUGHT                = *^S   ;
178        *BASETIME                               = *^T   ;
179        *WARNING                                = *^W   ;
180        *EXECUTABLE_NAME                        = *^X   ;
181        *OSNAME                                 = *^O   ;
182
183# Deprecated.
184
185#       *ARRAY_BASE                             = *[    ;
186#       *OFMT                                   = *#    ;
187#       *MULTILINE_MATCHING                     = **    ;
188#       *OLD_PERL_VERSION                       = *]    ;
189
1901;
Note: See TracBrowser for help on using the repository browser.