*** perl.texinfo-0.5-release Thu Dec 5 10:35:36 1991 --- perl.texinfo Mon Sep 13 12:43:15 1993 *************** *** 10,17 **** GNU Texinfo version adapted by Jeff Kellem . ! Copyright @copyright{} 1989, 1990, 1991 Larry Wall ! Texinfo version Copyright @copyright{} 1990, 1991 Jeff Kellem Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are --- 10,17 ---- GNU Texinfo version adapted by Jeff Kellem . ! Copyright @copyright{} 1989, 1990, 1991, 1992, 1993 Larry Wall ! Texinfo version Copyright @copyright{} 1990, 1991, 1993 Jeff Kellem Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are *************** *** 40,47 **** @titlepage @title Perl Manual (Texinfo version) ! @subtitle for perl version 4.0 patchlevel 19 ! @subtitle Edition 0.5, dated 04 December 1991, printed on @today{} @sp 2 @center This is a @strong{DRAFT} copy of the Texinfo version of the perl manual! --- 40,47 ---- @titlepage @title Perl Manual (Texinfo version) ! @subtitle for perl version 4.0 patchlevel 36 ! @subtitle Edition 0.6, dated 13 September 1993, printed on @today{} @sp 2 @center This is a @strong{DRAFT} copy of the Texinfo version of the perl manual! *************** *** 50,58 **** @author Texinfo version by Jeff Kellem @page @vskip 0pt plus 1filll ! Copyright @copyright{} 1989, 1990, 1991 Larry Wall @* ! Texinfo version Copyright @copyright{} 1990, 1991 Jeff Kellem Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are --- 50,58 ---- @author Texinfo version by Jeff Kellem @page @vskip 0pt plus 1filll ! Copyright @copyright{} 1989, 1990, 1991, 1992, 1993 Larry Wall @* ! Texinfo version Copyright @copyright{} 1990, 1991, 1993 Jeff Kellem Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are *************** *** 77,84 **** @comment node-name, next, previous, up @ifinfo ! This Info file contains edition 0.5, dated 04 December 1991, "printed" on ! @today{} of the Perl Manual for Perl version 4.0 patchlevel 19. This is a @strong{DRAFT} copy of the Texinfo version of the perl manual! @end ifinfo --- 77,84 ---- @comment node-name, next, previous, up @ifinfo ! This Info file contains edition 0.6, dated 13 September 1993, "printed" on ! @today{} of the Perl Manual for Perl version 4.0 patchlevel 36. This is a @strong{DRAFT} copy of the Texinfo version of the perl manual! @end ifinfo *************** *** 147,166 **** the manual. They are:@refill @example ! @strong{Mailing Address} @strong{What The Address Is For} ! perl-manual-request@@chem.bu.edu administrivia (add/drop requests) ! perl-manual@@chem.bu.edu discussion of the Texinfo perl manual ! bug-perl-manual@@chem.bu.edu reporting bugs in the perl manual @end example If you would like to join the discussion of the perl manual, send a note to @example ! perl-manual-request@@chem.bu.edu @end example ! The mailing list will be maintained on chem.bu.edu for some time, but ! will probably move to Beyond.Dreams.ORG, in the future. FYI. @node Copying, Conditions, Introduction, Top @unnumbered GNU General Public License --- 147,180 ---- the manual. They are:@refill @example ! @strong{Mailing Address} @strong{What The Address Is For} ! perl-manual-request@@Beyond.Dreams.ORG administrivia (add/drop requests) ! perl-manual@@Beyond.Dreams.ORG discussion of the Texinfo perl manual ! bug-perl-manual@@Beyond.Dreams.ORG reporting bugs in the perl manual @end example + @noindent If you would like to join the discussion of the perl manual, send a note to @example ! perl-manual-request@@Beyond.Dreams.ORG ! @end example ! ! @noindent ! The latest edition of the Texinfo version of the Perl manual is available ! via anonymous ftp from: ! ! @example ! ftp.dreams.org @end example + @noindent + in the ! @example ! /pub/perl-manual ! @end example ! @noindent ! directory. @node Copying, Conditions, Introduction, Top @unnumbered GNU General Public License *************** *** 886,892 **** a number, but scalar variables and values are interpreted as strings or numbers as appropriate to the context. A scalar is interpreted as TRUE in the boolean sense if it is not the null string or 0. Booleans ! returned by operators are 1 for TRUE and 0 or @'@' (the null string [two single right quotes]) for FALSE.@refill There are actually two varieties of null strings: @dfn{defined} and --- 900,906 ---- a number, but scalar variables and values are interpreted as strings or numbers as appropriate to the context. A scalar is interpreted as TRUE in the boolean sense if it is not the null string or 0. Booleans ! returned by operators are 1 for TRUE and 0 or @w{'}@w{'} (the null string [two single right quotes]) for FALSE.@refill There are actually two varieties of null strings: @dfn{defined} and *************** *** 998,1003 **** --- 1012,1018 ---- .23E-10 0xffff # hex 0377 # octal + 4_294_967_296 @end example @cindex String literals *************** *** 1054,1061 **** program. They may only be used as separate tokens; they will not be interpolated into strings. In addition, the token @samp{__END__} may be used to indicate the logical end of the script before the actual end of ! file. Any following text is ignored (but may be read via the ! @samp{DATA} filehandle). The two control characters @kbd{@ctrl{D}} and @kbd{@ctrl{Z}} are synonyms for @samp{__END__}.@refill A word that doesn't have any other interpretation in the grammar will be --- 1069,1078 ---- program. They may only be used as separate tokens; they will not be interpolated into strings. In addition, the token @samp{__END__} may be used to indicate the logical end of the script before the actual end of ! file. Any following text is ignored, but may be read via the ! @samp{DATA} filehandle. (The @samp{DATA} filehandle may read data only ! from the main script, but not from any required file or evaluated string.) ! The two control characters @kbd{@ctrl{D}} and @kbd{@ctrl{Z}} are synonyms for @samp{__END__}.@refill A word that doesn't have any other interpretation in the grammar will be *************** *** 1301,1307 **** @end example @noindent ! is equivalent to @example unshift(@@ARGV, '-') if $#ARGV < $[; --- 1318,1324 ---- @end example @noindent ! is equivalent to the following Perl-like pseudo code: @example unshift(@@ARGV, '-') if $#ARGV < $[; *************** *** 1314,1326 **** @end example @noindent ! except that it isn't as cumbersome to say. It really does shift array ! @samp{ARGV} and put the current filename into variable @samp{ARGV}. It ! also uses filehandle @samp{ARGV} internally. You can modify ! @samp{@@ARGV} before the first @samp{<>} as long as you leave the first ! filename at the beginning of the array. Line numbers (@samp{$.}) ! continue as if the input was one big happy file. (But see example under ! @code{eof} for how to reset line numbers on each file.)@refill @comment @@@@ ADD XREF @@@@ If you want to set @samp{@@ARGV} to your own list of files, go right --- 1331,1348 ---- @end example @noindent ! except that it isn't as cumbersome to say, and will actually work. It ! really does shift array @samp{ARGV} and put the current filename into ! variable @samp{ARGV}. It also uses filehandle @samp{ARGV} ! internally---@samp{<>} is just a synonym for @samp{}, which is ! magical. (The pseudo code above doesn't work because it treats ! @samp{} as non-magical.) ! ! You can modify @samp{@@ARGV} before the first @samp{<>} as long as the ! array ends up containing the list of filenames you really want. ! Line numbers (@samp{$.}) continue as if the input was one big happy ! file. (But see example under @code{eof} for how to reset line numbers ! on each file.)@refill @comment @@@@ ADD XREF @@@@ If you want to set @samp{@@ARGV} to your own list of files, go right *************** *** 1626,1637 **** @cindex Statements, Simple The only kind of simple statement is an expression evaluated for its ! side effects. Every expression (simple statement) must be terminated ! with a semicolon. Note that this is like C, but unlike Pascal (and ! @code{awk}).@refill Any simple statement may optionally be followed by a single modifier, ! just before the terminating semicolon. The possible modifiers are: @cindex Statement modifiers @cindex Modifiers, statement --- 1648,1660 ---- @cindex Statements, Simple The only kind of simple statement is an expression evaluated for its ! side effects. Every simple statement must be terminated with a ! semicolon, unless it is the final statement in a block, in which case ! the semicolon is optional. (Semicolon is still encouraged there if the ! block takes up more than one line).@refill Any simple statement may optionally be followed by a single modifier, ! just before the terminating semicolon. The possible modifiers are:@refill @cindex Statement modifiers @cindex Modifiers, statement *************** *** 1767,1783 **** arrays.@refill In a scalar context, @samp{..} returns a boolean value. The operator is ! bistable, like a flip-flop. Each @samp{..} operator maintains its own boolean state. It is false as long as its left operand is false. Once the left operand is true, the range operator stays true until the right operand is true, @strong{AFTER} which the range operator becomes false again. (It doesn't become false till the next time the range operator ! is evaluated. It can become false on the same evaluation it became ! true, but it still returns true once.) The right operand is not evaluated while the operator is in the ``false'' state, and the left operand is not evaluated while the operator is in the ``true'' state. ! The scalar @samp{..} operator is primarily intended for doing line ! number ranges after the fashion of @code{sed} or @code{awk}. The precedence is a little lower than @samp{||} and @samp{&&}. The value returned is either the null string for false, or a sequence number (beginning with 1) for true. The sequence number is reset for each --- 1790,1810 ---- arrays.@refill In a scalar context, @samp{..} returns a boolean value. The operator is ! bistable, like a flip-flop, and emulates the line-range (comma) operator ! of @code{sed}, @code{awk}, and various editors. Each @samp{..} operator ! maintains its own boolean state. It is false as long as its left operand is false. Once the left operand is true, the range operator stays true until the right operand is true, @strong{AFTER} which the range operator becomes false again. (It doesn't become false till the next time the range operator ! is evaluated. It can test the right operand and become false on the same ! evaluation it became true (as in @code{awk}), but it still returns true ! once. If you don't want it to test the right operand till the next ! evaluation (as in @code{sed}), use three dots (@dots{}) instead of two.) ! The right operand is not evaluated while the operator is in the ``false'' state, and the left operand is not evaluated while the operator is in the ``true'' state. ! The precedence is a little lower than @samp{||} and @samp{&&}. The value returned is either the null string for false, or a sequence number (beginning with 1) for true. The sequence number is reset for each *************** *** 1814,1832 **** A file test. This unary operator takes one argument, either a filename or a filehandle, and tests the associated file to see if something is true about it. If the argument is omitted, tests @samp{$_}, except for ! @samp{-t}, which tests @samp{STDIN}. It returns 1 for true and @'@' for false, or the undefined value if the file doesn't exist. Precedence is higher than logical and relational operators, but lower than arithmetic operators. The operator may be any of:@refill @example ! -r File is readable by effective uid. ! -w File is writable by effective uid. ! -x File is executable by effective uid. -o File is owned by effective uid. ! -R File is readable by real uid. ! -W File is writable by real uid. ! -X File is executable by real uid. -O File is owned by real uid. -e File exists. -z File has zero size. --- 1841,1859 ---- A file test. This unary operator takes one argument, either a filename or a filehandle, and tests the associated file to see if something is true about it. If the argument is omitted, tests @samp{$_}, except for ! @samp{-t}, which tests @samp{STDIN}. It returns 1 for true and @w{'}@w{'} for false, or the undefined value if the file doesn't exist. Precedence is higher than logical and relational operators, but lower than arithmetic operators. The operator may be any of:@refill @example ! -r File is readable by effective uid/gid. ! -w File is writable by effective uid/gid. ! -x File is executable by effective uid/gid. -o File is owned by effective uid. ! -R File is readable by real uid/gid. ! -W File is writable by real uid/gid. ! -X File is executable by real uid/gid. -O File is owned by real uid. -e File exists. -z File has zero size. *************** *** 2005,2011 **** depending only on whether it is a LIST operator or not. LIST operators have lowest precedence. All other unary operators have a precedence greater than relational operators but less than arithmetic operators. ! @xref{Precedence}, for more info. @node Commands, Precedence, Expressions, Top @comment node-name, next, previous, up --- 2032,2052 ---- depending only on whether it is a LIST operator or not. LIST operators have lowest precedence. All other unary operators have a precedence greater than relational operators but less than arithmetic operators. ! @xref{Precedence}, for more info.@refill ! ! For operators that can be used in either a scalar or array context, ! failure is generally indicated in a scalar context by returning ! the undefined value, and in an array context by returning the null list. ! Remember though that ! @strong{THERE IS NO GENERAL RULE FOR CONVERTING A LIST INTO A SCALAR.} ! Each operator decides which sort of scalar it would be most ! appropriate to return. ! Some operators return the length of the list ! that would have been returned in an array context. ! Some operators return the first value in the list. ! Some operators return the last value in the list. ! Some operators return a count of successful operations. ! In general, they do what you want, unless you want consistency.@refill @node Commands, Precedence, Expressions, Top @comment node-name, next, previous, up *************** *** 2677,2692 **** @@articles = sort @@files; # same thing, but with explicit sort routine ! @@articles = sort @{ $a cmp $b; @} @@files; # same thing in reversed order ! @@articles = sort @{ $b cmp $a; @} @@files; # sort numerically ascending ! @@articles = sort @{ $a <=> $b; @} @@files; # sort numerically descending ! @@articles = sort @{ $b <=> $a; @} @@files; # sort using explicit subroutine name sub byage @{ --- 2718,2733 ---- @@articles = sort @@files; # same thing, but with explicit sort routine ! @@articles = sort @{ $a cmp $b @} @@files; # same thing in reversed order ! @@articles = sort @{ $b cmp $a @} @@files; # sort numerically ascending ! @@articles = sort @{ $a <=> $b @} @@files; # sort numerically descending ! @@articles = sort @{ $b <=> $a @} @@files; # sort using explicit subroutine name sub byage @{ *************** *** 2936,2942 **** $gid@{$login@} = $gid; @} @@ary = <$@{pattern@}>; # get filenames ! if ($uid@{$user@} eq @'@') @{ die "$user not in passwd file"; @} else @{ --- 2977,2983 ---- $gid@{$login@} = $gid; @} @@ary = <$@{pattern@}>; # get filenames ! if ($uid@{$user@} eq @w{'}@w{'}) @{ die "$user not in passwd file"; @} else @{ *************** *** 3065,3072 **** @cindex File statistics @findex stat Returns a 13-element array giving the statistics for a file, either the ! file opened via @var{FILEHANDLE}, or named by @var{EXPR}. Typically ! used as follows:@refill @example @cindex Example, @code{stat} function --- 3106,3114 ---- @cindex File statistics @findex stat Returns a 13-element array giving the statistics for a file, either the ! file opened via @var{FILEHANDLE}, or named by @var{EXPR}. ! Returns a null list if the @code{stat} fails. ! Typically used as follows:@refill @example @cindex Example, @code{stat} function *************** *** 3113,3119 **** @cindex Checking if function exists example @cindex Example, checking if @code{symlink} exists @cindex Example, checking if function exists ! $symlink_exists = (eval 'symlink("","");', $@@ eq @'@'); @end example @item truncate(@var{FILEHANDLE},@var{LENGTH}) --- 3155,3161 ---- @cindex Checking if function exists example @cindex Example, checking if @code{symlink} exists @cindex Example, checking if function exists ! $symlink_exists = (eval 'symlink("","");', $@@ eq @w{'}@w{'}); @end example @item truncate(@var{FILEHANDLE},@var{LENGTH}) *************** *** 3622,3628 **** @cindex Bitmasks and @code{select} system call @cindex Example, bitmasks and @code{select} @cindex Constructing bitmasks for @code{select} ! $rin = $win = $ein = @'@'; vec($rin,fileno(STDIN),1) = 1; vec($win,fileno(STDOUT),1) = 1; $ein = $rin | $win; --- 3664,3670 ---- @cindex Bitmasks and @code{select} system call @cindex Example, bitmasks and @code{select} @cindex Constructing bitmasks for @code{select} ! $rin = $win = $ein = @w{'}@w{'}; vec($rin,fileno(STDIN),1) = 1; vec($win,fileno(STDOUT),1) = 1; $ein = $rin | $win; *************** *** 3776,3782 **** @findex m/PATTERN/ @findex /PATTERN/ Searches a string for a pattern match, and returns true (1) or false ! (@'@'). If no string is specified via the @samp{=~} or @samp{!~} operator, the @samp{$_} string is searched. (The string specified with @samp{=~} need not be an lvalue---it may be the result of an expression evaluation, but remember the @samp{=~} binds rather tightly.) --- 3818,3824 ---- @findex m/PATTERN/ @findex /PATTERN/ Searches a string for a pattern match, and returns true (1) or false ! (@w{'}@w{'}). If no string is specified via the @samp{=~} or @samp{!~} operator, the @samp{$_} string is searched. (The string specified with @samp{=~} need not be an lvalue---it may be the result of an expression evaluation, but remember the @samp{=~} binds rather tightly.) *************** *** 3853,3859 **** ($one,$five,$fifteen) = (`uptime` =~ /(\d+\.\d+)/g); # scalar context ! $/ = 1; $* = 1; while ($paragraph = <>) @{ while ($paragraph =~ /[a-z]['")]*[.!?]+['")]*\s/g) @{ $sentences++; --- 3895,3901 ---- ($one,$five,$fifteen) = (`uptime` =~ /(\d+\.\d+)/g); # scalar context ! $/ = ""; $* = 1; while ($paragraph = <>) @{ while ($paragraph =~ /[a-z]['")]*[.!?]+['")]*\s/g) @{ $sentences++; *************** *** 3888,3894 **** single quotes are used, no interpretation is done on the replacement string (the @samp{e} modifier overrides this, however); if backquotes are used, the replacement string is a command to execute whose output ! will be used as the actual replacement text. If no string is specified via the @samp{=~} or @samp{!~} operator, the @samp{$_} string is searched and modified. (The string specified with @samp{=~} must be a scalar variable, an array element, or an assignment to one of those, --- 3930,3940 ---- single quotes are used, no interpretation is done on the replacement string (the @samp{e} modifier overrides this, however); if backquotes are used, the replacement string is a command to execute whose output ! will be used as the actual replacement text. ! If the @var{PATTERN} is delimited by bracketing quotes, the ! @var{REPLACEMENT} has its own pair of quotes, which may or may not be ! bracketing quotes, e.g. @code{s(foo)(bar)} or @code{s/bar/}. ! If no string is specified via the @samp{=~} or @samp{!~} operator, the @samp{$_} string is searched and modified. (The string specified with @samp{=~} must be a scalar variable, an array element, or an assignment to one of those, *************** *** 3984,3990 **** @cindex Simple fgrep example $search = 'while (<>) @{ study;'; foreach $word (@@words) @{ ! $search .= "++\$seen@{\$ARGV@} if /\b$word\b/;\n"; @} $search .= "@}"; @@ARGV = @@files; --- 4030,4036 ---- @cindex Simple fgrep example $search = 'while (<>) @{ study;'; foreach $word (@@words) @{ ! $search .= "++\$seen@{\$ARGV@} if /\\b$word\\b/;\n"; @} $search .= "@}"; @@ARGV = @@files; *************** *** 4011,4017 **** translated. (The string specified with @samp{=~} must be a scalar variable, an array element, or an assignment to one of those, i.e. an lvalue.) For @code{sed} devotees, @code{y} is provided as a synonym for ! @code{tr}. If the @samp{c} modifier is specified, the @var{SEARCHLIST} character set is complemented. If the @samp{d} modifier is specified, any --- 4057,4066 ---- translated. (The string specified with @samp{=~} must be a scalar variable, an array element, or an assignment to one of those, i.e. an lvalue.) For @code{sed} devotees, @code{y} is provided as a synonym for ! @code{tr}. If the @var{SEARCHLIST} is delimited by bracketing quotes, ! the @var{REPLACEMENTLIST} has its own pair of quotes, which may or may ! not be bracketing quotes, e.g. @code{tr[A-Z][a-z]} or ! @code{tr(+-*/)/ABCD/}.@refill If the @samp{c} modifier is specified, the @var{SEARCHLIST} character set is complemented. If the @samp{d} modifier is specified, any *************** *** 4268,4275 **** @findex endservent @comment @@@@ DON'T FORGET to do CINDEX stuff @@@@ These routines perform the same functions as their counterparts in the ! system library. The return values from the various get routines are as ! follows:@refill @example ($name,$passwd,$uid,$gid, --- 4317,4324 ---- @findex endservent @comment @@@@ DON'T FORGET to do CINDEX stuff @@@@ These routines perform the same functions as their counterparts in the ! system library. With an array context, the return values from the various ! get routines are as follows:@refill @example ($name,$passwd,$uid,$gid, *************** *** 4281,4290 **** ($name,$aliases,$port,$proto) = getserv@dots{} @end example The @samp{$members} value returned by @code{getgr@dots{}} is a space separated list of the login names of the members of the group.@refill ! The @samp{@@addrs} value returned by the @code{gethost@dots{}} functions is a list of the raw addresses returned by the corresponding system library call. In the Internet domain, each address is four bytes long and you can unpack it by saying something like:@refill --- 4330,4360 ---- ($name,$aliases,$port,$proto) = getserv@dots{} @end example + @noindent + (If the entry doesn't exist you get a null list.) + + Within a scalar context, you get the name, unless the function was a + lookup by name, in which case you get the other thing, whatever it is. + (If the entry doesn't exist you get the undefined value.) + For example:@refill + + @example + $uid = getpwnam + $name = getpwuid + $name = getpwent + $gid = getgrnam + $name = getgrgid + $name = getgrent + etc. + @end example + The @samp{$members} value returned by @code{getgr@dots{}} is a space separated list of the login names of the members of the group.@refill ! For the @code{gethost@dots{}} functions, if the @code{h_errno} variable ! is supported in C, it will be returned to you via @samp{$?} if the function ! call fails. ! The @samp{@@addrs} value returned by a successful call is a list of the raw addresses returned by the corresponding system library call. In the Internet domain, each address is four bytes long and you can unpack it by saying something like:@refill *************** *** 5232,5238 **** @end example Note that the file will not be included twice under the same specified ! name.@refill @item do @var{EXPR} @cindex @code{do EXPR} --- 5302,5311 ---- @end example Note that the file will not be included twice under the same specified ! name. The file must return true as the last statement to indicate ! successful execution of any initialization code, so it's customary to ! end such a file with @code{1;} unless you're sure it'll return true ! otherwise.@refill @item do @var{EXPR} @cindex @code{do EXPR} *************** *** 5348,5354 **** @cindex Declaring local variable examples sub RANGEVAL @{ local($min, $max, $thunk) = @@_; ! local($result) = @'@'; local($i); # Presumably $thunk makes reference to $i --- 5421,5427 ---- @cindex Declaring local variable examples sub RANGEVAL @{ local($min, $max, $thunk) = @@_; ! local($result) = @w{'}@w{'}; local($i); # Presumably $thunk makes reference to $i *************** *** 6402,6408 **** The input record separator, newline by default. Works like @code{awk}'s RS variable, including treating blank lines as delimiters if set to the null string. You may set it to a multicharacter string to match a ! multi-character delimiter. (Mnemonic: @samp{/} is used to delimit line boundaries when quoting poetry.)@refill @item $, --- 6475,6488 ---- The input record separator, newline by default. Works like @code{awk}'s RS variable, including treating blank lines as delimiters if set to the null string. You may set it to a multicharacter string to match a ! multi-character delimiter. ! Note that setting it to @code{"\n\n"} means something slightly different ! than setting it to @code{""}, if the file contains consecutive blank ! lines. Setting it to @code{""} will treat two or more consecutive blank ! lines as a single blank line. ! Setting it to "\en\en" will blindly assume that the next input character ! belongs to the next paragraph, even if it's a newline. ! (Mnemonic: @samp{/} is used to delimit line boundaries when quoting poetry.)@refill @item $, *************** *** 6473,6479 **** same as shells.)@refill @item $? ! The status returned by the last pipe close, backtick (@`@`) command or @code{system} operator. Note that this is the status word returned by the @code{wait()} system call, so the exit value of the subprocess is actually @samp{($? >> 8)}. @samp{$? & 255} gives which signal, if any, --- 6553,6559 ---- same as shells.)@refill @item $? ! The status returned by the last pipe close, backtick (@w{`}@w{`}) command or @code{system} operator. Note that this is the status word returned by the @code{wait()} system call, so the exit value of the subprocess is actually @samp{($? >> 8)}. @samp{$? & 255} gives which signal, if any, *************** *** 6481,6500 **** similar to @code{sh} and @code{ksh}.)@refill @item $& ! The string matched by the last pattern match (not counting any matches hidden within a BLOCK or @code{eval} enclosed by the current BLOCK). (Mnemonic: like @samp{&} in some editors.)@refill @item $` ! The string preceding whatever was matched by the last pattern match (not counting any matches hidden within a BLOCK or @code{eval} enclosed by ! the current BLOCK). (Mnemonic: @` often precedes a quoted string.)@refill @item $' ! The string following whatever was matched by the last pattern match (not counting any matches hidden within a BLOCK or @code{eval} enclosed by ! the current BLOCK). (Mnemonic: @' often follows a quoted string.) Example:@refill @example --- 6561,6583 ---- similar to @code{sh} and @code{ksh}.)@refill @item $& ! The string matched by the last successful pattern match (not counting ! any matches hidden within a BLOCK or @code{eval} enclosed by the current BLOCK). (Mnemonic: like @samp{&} in some editors.)@refill @item $` ! The string preceding whatever was matched by the last successful pattern ! match (not counting any matches hidden within a BLOCK or @code{eval} enclosed by ! the current BLOCK). (Mnemonic: ` often precedes a quoted string.)@refill @item $' ! The string following whatever was matched by the last successful pattern ! match (not counting any matches hidden within a BLOCK or @code{eval} enclosed by ! the current BLOCK). (Mnemonic: ' often follows a quoted string.) Example:@refill @example *************** *** 6689,6694 **** --- 6772,6780 ---- The current value of the inplace-edit extension. Use @code{undef} to disable inplace editing. (Mnemonic: value of @samp{-i} switch.)@refill + @item $^L + What formats output to perform a formfeed. Default is @samp{\f}. + @item $^P The internal flag that the debugger clears so that it doesn't debug itself. You could conceivably disable debugging yourself by clearing *************** *** 7129,7135 **** system "echo $abc"; # Insecure until PATH set $ENV@{'PATH'@} = '/bin:/usr/bin'; ! $ENV@{'IFS'@} = @'@' if $ENV@{'IFS'@} ne @'@'; $path = $ENV@{'PATH'@}; # Not tainted system "echo $abc"; # Is secure now! --- 7215,7221 ---- system "echo $abc"; # Insecure until PATH set $ENV@{'PATH'@} = '/bin:/usr/bin'; ! $ENV@{'IFS'@} = @w{'}@w{'} if $ENV@{'IFS'@} ne @w{'}@w{'}; $path = $ENV@{'PATH'@}; # Not tainted system "echo $abc"; # Is secure now! *************** *** 7186,7196 **** @chapter Environment @cindex Environment ! @emph{Perl} uses @samp{PATH} in executing subprocesses, and in finding the ! script if @samp{-S} is used. @samp{HOME} or @samp{LOGDIR} are used if ! @code{chdir} has no argument.@refill ! Apart from these, @emph{perl} uses no environment variables, except to make them available to the script being executed, and to child processes. However, scripts running setuid would do well to execute the following lines before doing anything else, just to keep people honest:@refill --- 7272,7298 ---- @chapter Environment @cindex Environment ! @table @asis ! @item HOME ! Used if @code{chdir} has no argument. ! @item LOGDIR ! Used if @code{chdir} has no argument and @samp{HOME} is not set. ! @item PATH ! Used im executing subprocesses, and in finding the script ! if @samp{-S} is used.@refill ! @item PERLLIB ! A colon-separated list of directories in which to look for @emph{Perl} ! library files before looking in the standard library and the current ! directory. ! @item PERLDB ! The command used to get the debugger code. If unset, uses: ! @example ! require 'perldb.pl' ! @end example ! @end table ! Apart from these, @emph{perl} uses no other environment variables, except ! to make them available to the script being executed, and to child processes. However, scripts running setuid would do well to execute the following lines before doing anything else, just to keep people honest:@refill *************** *** 7197,7204 **** @example $ENV@{'PATH'@} = '/bin:/usr/bin'; # or whatever you need ! $ENV@{'SHELL'@} = '/bin/sh' if $ENV@{'SHELL'@} ne @'@'; ! $ENV@{'IFS'@} = @'@' if $ENV@{'IFS'@} ne @'@'; @end example @section Files --- 7299,7306 ---- @example $ENV@{'PATH'@} = '/bin:/usr/bin'; # or whatever you need ! $ENV@{'SHELL'@} = '/bin/sh' if $ENV@{'SHELL'@} ne @w{'}@w{'}; ! $ENV@{'IFS'@} = @w{'}@w{'} if $ENV@{'IFS'@} ne @w{'}@w{'}; @end example @section Files *************** *** 7520,7526 **** @itemize @bullet @item ! Semicolons are required after all simple statements in @emph{perl}. Newline is not a statement delimiter.@refill @item Curly brackets are required on @code{if}s and @code{while}s.@refill --- 7622,7629 ---- @itemize @bullet @item ! Semicolons are required after all simple statements in @emph{perl} ! (except at the end of a block). Newline is not a statement delimiter.@refill @item Curly brackets are required on @code{if}s and @code{while}s.@refill *************** *** 7695,7701 **** While none of the built-in data types have any arbitrary size limits (apart from memory size), there are still a few arbitrary limits: a given identifier may not be longer than 255 characters, and no component ! of your @samp{PATH} may be longer than 255 if you use @samp{-S}.@refill @emph{Perl} actually stands for Pathologically Eclectic Rubbish Lister, but don't tell anyone I said that.@refill --- 7798,7806 ---- While none of the built-in data types have any arbitrary size limits (apart from memory size), there are still a few arbitrary limits: a given identifier may not be longer than 255 characters, and no component ! of your @samp{PATH} may be longer than 255 if you use @samp{-S}. ! A regular expression may not compile to more than 32767 bytes ! internally.@refill @emph{Perl} actually stands for Pathologically Eclectic Rubbish Lister, but don't tell anyone I said that.@refill *************** *** 8139,8144 **** --- 8244,8260 ---- @ignore ''' $Log: perl.man.1,v $ + ''' Revision 4.0.1.6 92/06/08 15:07:29 lwall + ''' patch20: documented that numbers may contain underline + ''' patch20: clarified that DATA may only be read from main script + ''' patch20: relaxed requirement for semicolon at the end of a block + ''' patch20: added ... as variant on .. + ''' patch20: documented need for 1; at the end of a required file + ''' patch20: extended bracket-style quotes to two-arg operators: s()() and tr()() + ''' patch20: paragraph mode now skips extra newlines automatically + ''' patch20: documented PERLLIB and PERLDB + ''' patch20: documented limit on size of regexp + ''' ''' Revision 4.0.1.5 91/11/11 16:42:00 lwall ''' patch19: added little-endian pack/unpack options '''