-
Notifications
You must be signed in to change notification settings - Fork 560
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
[PATCH] Make symbolic references diagnostic less cryptic #12069
Comments
From @SmylersThis is a bug report for perl from Smylers@stripey.com, From 34d0e59777e8cf0638f92115e3a31a9d9be5637c Mon Sep 17 00:00:00 2001 If somebody has accidentally used a symbolic reference with strict enabled and So explain the error in terms of what the user has done, not what sort of pod/perldiag.pod | 9 +++++++-- Inline Patchdiff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 9a8c934..3cf0188 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -1268,8 +1268,13 @@ test the type of the reference, if need be.
=item Can't use string ("%s") as %s ref while "strict refs" in use
-(F) Only hard references are allowed by "strict refs". Symbolic
-references are disallowed. See L<perlref>.
+(F) You've told Perl to dereference a string, something which C<use strict>
+blocks to prevent it happening accidentally. See
+L<perlref/"Symbolic references">. This can be triggered by an C<@> or C<$> in a
+double-quoted string immediately before interpolating a variable, for example
+in C<"user @$twitter_id">, which says to treat the contents of C<$twitter_id>
+as an array reference; use a C<\> to have a literal C<@> symbol followed by the
+contents of C<$twitter_id>: C<"user \@$twitter_id">.
=item Can't use subscript on %s
--
Flags: Site configuration information for perl 5.15.9: Configured by smyers at Thu Apr 12 12:48:17 BST 2012. Summary of my perl5 (revision 5 version 15 subversion 9) configuration: Locally applied patches: @INC for perl 5.15.9: Environment for perl 5.15.9: |
From @cpansproutOn Thu Apr 19 05:10:21 2012, smylers@stripey.com wrote:
That sounds good. We are currently in code freeze, but I hope to apply -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From perl-diddler@tlinx.orgSmylers (via RT) wrote:
Anything that increases the clarity of perl error messages is, IMO, |
From @cpansproutOn Thu Apr 19 05:10:21 2012, smylers@stripey.com wrote:
Thank you. Applied as 3f38d37. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#112542 (status was 'resolved')
Searchable as RT112542$
The text was updated successfully, but these errors were encountered: