Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

187 lines
3.6 KiB

  1. package English;
  2. require Exporter;
  3. @ISA = (Exporter);
  4. =head1 NAME
  5. English - use nice English (or awk) names for ugly punctuation variables
  6. =head1 SYNOPSIS
  7. use English;
  8. ...
  9. if ($ERRNO =~ /denied/) { ... }
  10. =head1 DESCRIPTION
  11. You should I<not> use this module in programs intended to be portable
  12. among Perl versions, programs that must perform regular expression
  13. matching operations efficiently, or libraries intended for use with
  14. such programs. In a sense, this module is deprecated. The reasons
  15. for this have to do with implementation details of the Perl
  16. interpreter which are too thorny to go into here. Perhaps someday
  17. they will be fixed to make "C<use English>" more practical.
  18. This module provides aliases for the built-in variables whose
  19. names no one seems to like to read. Variables with side-effects
  20. which get triggered just by accessing them (like $0) will still
  21. be affected.
  22. For those variables that have an B<awk> version, both long
  23. and short English alternatives are provided. For example,
  24. the C<$/> variable can be referred to either $RS or
  25. $INPUT_RECORD_SEPARATOR if you are using the English module.
  26. See L<perlvar> for a complete list of these.
  27. =cut
  28. local $^W = 0;
  29. # Grandfather $NAME import
  30. sub import {
  31. my $this = shift;
  32. my @list = @_;
  33. local $Exporter::ExportLevel = 1;
  34. Exporter::import($this,grep {s/^\$/*/} @list);
  35. }
  36. @EXPORT = qw(
  37. *ARG
  38. *MATCH
  39. *PREMATCH
  40. *POSTMATCH
  41. *LAST_PAREN_MATCH
  42. *INPUT_LINE_NUMBER
  43. *NR
  44. *INPUT_RECORD_SEPARATOR
  45. *RS
  46. *OUTPUT_AUTOFLUSH
  47. *OUTPUT_FIELD_SEPARATOR
  48. *OFS
  49. *OUTPUT_RECORD_SEPARATOR
  50. *ORS
  51. *LIST_SEPARATOR
  52. *SUBSCRIPT_SEPARATOR
  53. *SUBSEP
  54. *FORMAT_PAGE_NUMBER
  55. *FORMAT_LINES_PER_PAGE
  56. *FORMAT_LINES_LEFT
  57. *FORMAT_NAME
  58. *FORMAT_TOP_NAME
  59. *FORMAT_LINE_BREAK_CHARACTERS
  60. *FORMAT_FORMFEED
  61. *CHILD_ERROR
  62. *OS_ERROR
  63. *ERRNO
  64. *EXTENDED_OS_ERROR
  65. *EVAL_ERROR
  66. *PROCESS_ID
  67. *PID
  68. *REAL_USER_ID
  69. *UID
  70. *EFFECTIVE_USER_ID
  71. *EUID
  72. *REAL_GROUP_ID
  73. *GID
  74. *EFFECTIVE_GROUP_ID
  75. *EGID
  76. *PROGRAM_NAME
  77. *PERL_VERSION
  78. *ACCUMULATOR
  79. *DEBUGGING
  80. *SYSTEM_FD_MAX
  81. *INPLACE_EDIT
  82. *PERLDB
  83. *BASETIME
  84. *WARNING
  85. *EXECUTABLE_NAME
  86. *OSNAME
  87. );
  88. # The ground of all being. @ARG is deprecated (5.005 makes @_ lexical)
  89. *ARG = *_ ;
  90. # Matching.
  91. *MATCH = *& ;
  92. *PREMATCH = *` ;
  93. *POSTMATCH = *' ;
  94. *LAST_PAREN_MATCH = *+ ;
  95. # Input.
  96. *INPUT_LINE_NUMBER = *. ;
  97. *NR = *. ;
  98. *INPUT_RECORD_SEPARATOR = */ ;
  99. *RS = */ ;
  100. # Output.
  101. *OUTPUT_AUTOFLUSH = *| ;
  102. *OUTPUT_FIELD_SEPARATOR = *, ;
  103. *OFS = *, ;
  104. *OUTPUT_RECORD_SEPARATOR = *\ ;
  105. *ORS = *\ ;
  106. # Interpolation "constants".
  107. *LIST_SEPARATOR = *" ;
  108. *SUBSCRIPT_SEPARATOR = *; ;
  109. *SUBSEP = *; ;
  110. # Formats
  111. *FORMAT_PAGE_NUMBER = *% ;
  112. *FORMAT_LINES_PER_PAGE = *= ;
  113. *FORMAT_LINES_LEFT = *- ;
  114. *FORMAT_NAME = *~ ;
  115. *FORMAT_TOP_NAME = *^ ;
  116. *FORMAT_LINE_BREAK_CHARACTERS = *: ;
  117. *FORMAT_FORMFEED = *^L ;
  118. # Error status.
  119. *CHILD_ERROR = *? ;
  120. *OS_ERROR = *! ;
  121. *ERRNO = *! ;
  122. *EXTENDED_OS_ERROR = *^E ;
  123. *EVAL_ERROR = *@ ;
  124. # Process info.
  125. *PROCESS_ID = *$ ;
  126. *PID = *$ ;
  127. *REAL_USER_ID = *< ;
  128. *UID = *< ;
  129. *EFFECTIVE_USER_ID = *> ;
  130. *EUID = *> ;
  131. *REAL_GROUP_ID = *( ;
  132. *GID = *( ;
  133. *EFFECTIVE_GROUP_ID = *) ;
  134. *EGID = *) ;
  135. *PROGRAM_NAME = *0 ;
  136. # Internals.
  137. *PERL_VERSION = *] ;
  138. *ACCUMULATOR = *^A ;
  139. *COMPILING = *^C ;
  140. *DEBUGGING = *^D ;
  141. *SYSTEM_FD_MAX = *^F ;
  142. *INPLACE_EDIT = *^I ;
  143. *PERLDB = *^P ;
  144. *BASETIME = *^T ;
  145. *WARNING = *^W ;
  146. *EXECUTABLE_NAME = *^X ;
  147. *OSNAME = *^O ;
  148. # Deprecated.
  149. # *ARRAY_BASE = *[ ;
  150. # *OFMT = *# ;
  151. # *MULTILINE_MATCHING = ** ;
  152. 1;