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.

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