From: Perl 5 Porters Date: Wed, 28 Aug 1996 02:32:42 +0000 (+0000) Subject: lval substr() coredumps with refs (with patch) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b7a902f4f873ea955859f89894f7d3c3b721fc0d;p=p5sagit%2Fp5-mst-13.2.git 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). --- diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 1b03800..2698b3f 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. + =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