develooper Front page | perl.perl5.porters | Postings from April 2000

Re: [ID 20000403.009] uninitialised concatenation???

From:
David Glasser
Date:
April 4, 2000 19:52
Subject:
Re: [ID 20000403.009] uninitialised concatenation???
Message ID:
l03130302b51054572b38@[209.195.241.145]
Does this make anybody happy?

(Also, it may be relevant to mention that B::Deparse gives different results for 'print " " . $a' and 'print " $a"', but I'm probably missing something.  Also, exploration of this came up with another uninitialized value problem in B::Deparse, but I'm too lazy to look at it now.)

--- perl-5.6.0/pod/perldiag.pod.orig	Tue Apr  4 21:56:57 2000
+++ perl-5.6.0/pod/perldiag.pod	Tue Apr  4 22:02:54 2000
@@ -3358,7 +3358,12 @@
 
 (W uninitialized) An undefined value was used as if it were already defined.  It was
 interpreted as a "" or a 0, but maybe it was a mistake.  To suppress this
-warning assign a defined value to your variables.
+warning assign a defined value to your variables.  To help you figure out what was
+undefined, perl tells you what opcode you used an undefined value in.  Note, however,
+that perl optimizes your program and the opcode displayed by your program may not
+necessarily appear literally in your program.  For example, C<"that $foo"> is
+usually optimized into C<"that " . $foo>, and the warning will refer to
+the C<concatenation (.)> opcode, even though there is no C<.> in your program.
 
 =item Useless use of "re" pragma
 





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About