diff options
author | M. J. T. Guy <mjtg@cus.cam.ac.uk> | 1998-07-28 13:44:36 +0100 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-08-02 03:45:26 +0000 |
commit | 8e30cc93fcf10cc99533d7ed3161b6c4a0fabd93 (patch) | |
tree | 7047eb5fa7698557bab07645ee6e3a3e09af1711 /pod | |
parent | 39ca2bb7cd8f975c0e460242f7deaed80ab31ddc (diff) | |
download | perl-8e30cc93fcf10cc99533d7ed3161b6c4a0fabd93.tar.gz |
document return values of do() better
Message-Id: <E0z18BI-0003cH-00@taurus.cus.cam.ac.uk>
Subject: [PATCH] Re: Obscurity of lexicals with do ""
p4raw-id: //depot/maint-5.005/perl@1683
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlfunc.pod | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 35cab3adb3..69dd5aa7eb 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -915,6 +915,12 @@ scope like 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. + Note that inclusion of library modules is better done with the C<use()> and C<require()> operators, which also do automatic error checking and raise an exception if there's a problem. |