This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlre.pod spellcheck
[perl5.git] / pod / perlfunc.pod
index ab02136..d7d9044 100644 (file)
@@ -4259,14 +4259,17 @@ C<chdir> there, it would have been testing the wrong file.
     closedir DIR;
 
 =item readline EXPR
+
+=item readline
 X<readline> X<gets> X<fgets>
 
-Reads from the filehandle whose typeglob is contained in EXPR.  In scalar
-context, each call reads and returns the next line, until end-of-file is
-reached, whereupon the subsequent call returns undef.  In list context,
-reads until end-of-file is reached and returns a list of lines.  Note that
-the notion of "line" used here is however you may have defined it
-with C<$/> or C<$INPUT_RECORD_SEPARATOR>).  See L<perlvar/"$/">.
+Reads from the filehandle whose typeglob is contained in EXPR (or from
+*ARGV if EXPR is not provided).  In scalar context, each call reads and
+returns the next line, until end-of-file is reached, whereupon the
+subsequent call returns undef.  In list context, reads until end-of-file
+is reached and returns a list of lines.  Note that the notion of "line"
+used here is however you may have defined it with C<$/> or
+C<$INPUT_RECORD_SEPARATOR>).  See L<perlvar/"$/">.
 
 When C<$/> is set to C<undef>, when readline() is in scalar
 context (i.e. file slurp mode), and when an empty file is read, it
@@ -4464,8 +4467,9 @@ version should be used instead.
 
 Otherwise, C<require> demands that a library file be included if it
 hasn't already been included.  The file is included via the do-FILE
-mechanism, which is essentially just a variety of C<eval>.  Has
-semantics similar to the following subroutine:
+mechanism, which is essentially just a variety of C<eval> with the
+caveat that lexical variables in the invoking script will be invisible
+to the included code.  Has semantics similar to the following subroutine:
 
     sub require {
        my ($filename) = @_;
@@ -4722,7 +4726,7 @@ X<say>
 =item say
 
 Just like C<print>, but implicitly appends a newline.
-C<say LIST> is simply an abbreviation for C<{ local $/ = "\n"; print
+C<say LIST> is simply an abbreviation for C<{ local $\ = "\n"; print
 LIST }>.
 
 This keyword is only available when the "say" feature is
@@ -6007,7 +6011,7 @@ X<state>
 =item state TYPE EXPR : ATTRS
 
 C<state> declares a lexically scoped variable, just like C<my> does.
-However, those variables will be initialized only once, contrary to
+However, those variables will never be reinitialized, contrary to
 lexical variables that are reinitialized each time their enclosing block
 is entered.