From: Gurusamy Sarathy Date: Mon, 15 Feb 1999 04:45:55 +0000 (+0000) Subject: clarify what a "line" is X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=883faa132e8bf2c932ff9f7c1722950f4325a1d7;p=p5sagit%2Fp5-mst-13.2.git clarify what a "line" is p4raw-id: //depot/perl@2932 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 07e1b7e..d5b631b 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -908,7 +908,12 @@ Equivalent examples: If the value of EXPR does not end in a newline, the current script line number and input line number (if any) are also printed, and a newline -is supplied. Hint: sometimes appending C<", stopped"> to your message +is supplied. Note that the "input line number" (also known as "chunk") +is subject to whatever notion of "line" happens to be currently in +effect, and is also available as the special variable C<$.>. +See L and L. + +Hint: sometimes appending C<", stopped"> to your message will cause it to make better sense when the string C<"at foo line 123"> is appended. Suppose you are running script "canasta". diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 38d6d32..2dafc1c 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -222,7 +222,10 @@ the C and C modifiers on pattern matching. =item $. The current input line number for the last file handle from -which you read (or performed a C or C on). An +which you read (or performed a C or C on). The value +may be different from the actual physical line number in the file, +depending on what notion of "line" is in effect--see L<$/> on how +to affect that. An explicit close on a filehandle resets the line number. Because "CE>" never does an explicit close, line numbers increase across ARGV files (but see examples under eof()). Localizing C<$.> has @@ -238,7 +241,8 @@ number.) =item $/ -The input record separator, newline by default. Works like B's RS +The input record separator, newline by default. This is used to +influence Perl's idea of what a "line" is. Works like B's RS variable, including treating empty lines as delimiters if set to the null string. (Note: An empty line cannot contain any spaces or tabs.) You may set it to a multi-character string to match a multi-character @@ -278,6 +282,8 @@ likely not a problem, as any file you'd want to read in record mode is probably usable in line mode) Non-VMS systems perform normal I/O, so it's safe to mix record and non-record reads of a file. +Also see L<$.>. + =item autoflush HANDLE EXPR =item $OUTPUT_AUTOFLUSH