-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perlvar $@ could be improved #14572
Comments
From @maukeCreated by @mauke$ perldoc -v '$@' ... This description somewhat misses the point. - it implies $@ is only set by eval STRING and for compiler errors ("syntax Perl Info
|
From @jkeenanOn Mon Mar 09 22:46:38 2015, mauke- wrote:
I agree with at least your last bullet point. Could you provide a patch with alternative working for people to chew over? Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn Mon Apr 27 18:08:19 2015, jkeenan wrote:
mauke: Any possibility of getting a patch? Thank you very much. -- |
From @maukeOn Wed Dec 09 15:58:31 2015, jkeenan wrote:
Yes, thanks for the reminder. See the attachment. Comments? |
From @mauke0001-reword-documentation-it-s-not-just-for-syntax-errors.patchFrom a37623716b4aae990e70fa50b5130237d5b0faa2 Mon Sep 17 00:00:00 2001
From: Lukas Mai <l.mai@web.de>
Date: Thu, 10 Dec 2015 01:20:47 +0100
Subject: [PATCH] reword $@ documentation (it's not just for syntax errors)
RT #124034
---
pod/perlvar.pod | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index f5922ad..09ec06d 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -1667,12 +1667,12 @@ Under a few operating systems, C<$^E> may contain a more verbose error
indicator, such as in this case, "CDROM tray not closed." Systems that
do not support extended error messages leave C<$^E> the same as C<$!>.
-Finally, C<$?> may be set to non-0 value if the external program
+Finally, C<$?> may be set to a non-0 value if the external program
F</cdrom/install> fails. The upper eight bits reflect specific error
conditions encountered by the program (the program's C<exit()> value).
The lower eight bits reflect mode of failure, like signal death and
core dump information. See L<wait(2)> for details. In contrast to
-C<$!> and C<$^E>, which are set only if error condition is detected,
+C<$!> and C<$^E>, which are set only if an error condition is detected,
the variable C<$?> is set on each C<wait> or pipe C<close>,
overwriting the old value. This is more like C<$@>, which on every
C<eval()> is always set on failure and cleared on success.
@@ -1867,17 +1867,18 @@ Mnemonic: similar to B<sh> and B<ksh>.
=item $@
X<$@> X<$EVAL_ERROR>
-The Perl syntax error message from the
-last C<eval()> operator. If C<$@> is
-the null string, the last C<eval()> parsed and executed correctly
-(although the operations you invoked may have failed in the normal
-fashion).
+The Perl error from the last C<eval> operator, i.e. the last exception that
+was caught. For C<eval BLOCK>, this is either a runtime error message or the
+string or reference C<die> was called with. The C<eval STRING> form also
+catches syntax errors and other compile time exceptions.
+
+If no error occurs, C<eval> sets C<$@> to the empty string.
Warning messages are not collected in this variable. You can, however,
set up a routine to process warnings by setting C<$SIG{__WARN__}> as
described in L</%SIG>.
-Mnemonic: Where was the syntax error "at"?
+Mnemonic: Where was the error "at"?
=back
--
2.6.3
|
@jkeenan - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#124034 (status was 'resolved')
Searchable as RT124034$
The text was updated successfully, but these errors were encountered: