summaryrefslogtreecommitdiff
path: root/pod/perlfunc.pod
diff options
context:
space:
mode:
authorDavid Golden <dagolden@cpan.org>2011-03-19 21:55:15 -0400
committerDavid Golden <dagolden@cpan.org>2011-03-19 21:56:14 -0400
commit9dc513c5b9d0e550b78612e42579f1e6e851510a (patch)
treee3f1a72c60efdc9276e6521c76fd8532c5264406 /pod/perlfunc.pod
parent26c2326b46704cafd4b19d846967af1bedd35ad5 (diff)
downloadperl-9dc513c5b9d0e550b78612e42579f1e6e851510a.tar.gz
perlfunc: clarified 'do FILE' error checking
Partial fix for RT #80626
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r--pod/perlfunc.pod10
1 files changed, 5 insertions, 5 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 0185762d79..0d9a65cbec 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -1419,11 +1419,11 @@ cannot see lexicals in the enclosing scope; C<eval STRING> does. It's the
same, however, in that it does reparse the file every time you call it,
so you probably don't want to do this inside a loop.
-If C<do> cannot read the file, it returns undef and sets C<$!> to the
-error. If C<do> can read the file but cannot compile it, it
-returns undef and sets an error message in C<$@>. If the file is
-successfully compiled, C<do> returns the value of the last expression
-evaluated.
+If C<do> can read the file but cannot compile it, it returns undef and sets
+an error message in C<$@>. If C<do> cannot read the file, it returns undef
+and sets C<$!> to the error. Always check C<$@> first, as compilation
+could fail in a way that also sets C<$!>. If the file is successfully
+compiled, C<do> returns the value of the last expression evaluated.
Inclusion of library modules is better done with the
C<use> and C<require> operators, which also do automatic error checking