summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-08-28 02:32:42 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-08-28 02:32:42 +0000
commitb7a902f4f873ea955859f89894f7d3c3b721fc0d (patch)
treed91db21d10ddf00f5b133d93c4ef514fcebfc75f
parentc411622ed1115558a052ffa629b6bd710abfef5c (diff)
downloadperl-b7a902f4f873ea955859f89894f7d3c3b721fc0d.tar.gz
lval substr() coredumps with refs (with patch)
substr() coredumps with a target that is a ref, when it is used in an lvalue context. The patch below corrects the problem by stringifying the reference first (and emitting a warning when appropriate).
-rw-r--r--pod/perldiag.pod6
1 files changed, 6 insertions, 0 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 1b03800702..2698b3f46d 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -231,6 +231,12 @@ could indicate that SvREFCNT_dec() was called too many times, or that
SvREFCNT_inc() was called too few times, or that the SV was mortalized
when it shouldn't have been, or that memory has been corrupted.
+=item Attempt to use reference as lvalue in substr
+
+(W) You supplied a reference as the first argument to substr() used
+as an lvalue, which is pretty strange. Perhaps you forgot to
+dereference it first. See L<perlfunc/substr>.
+
=item Bad arg length for %s, is %d, should be %d
(F) You passed a buffer of the wrong size to one of msgctl(), semctl() or