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

Re: [ID 20000330.052] Use of uninitialized value in concatenation (.)

From:
hermit
Date:
March 30, 2000 20:02
Subject:
Re: [ID 20000330.052] Use of uninitialized value in concatenation (.)
Message ID:
14564.9008.897189.980753@komodo.bayview.com
Tom Christiansen writes:
 > That is, however, what's happening:
 > 
 > % perl -MO=Deparse,-q -e '@scalar = @array = (1..10); print "this $scalar and that @array\n"'
 > @scalar = (@array = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
 > print 'this ' . $scalar . ' and that ' . join($", @array) . "\n";

To resolve this bug I would like to see one of two things happen:

1. Remember whether we are doing variable interpolation or if the user
actually spelled it out with '.' between each part of the string, and
give either "... in concatenation (.)" or "... in string interpolation"
as the warning, or

2. Modify the warning message to not be so specific, like this:
"... in concatenation (.) or string interpolation"

Obviously #2 is easier, but #1 is probably the Right Way(tm).  Ideas?

--Bill.

-- 
William R Ward        hermit@bayview.com      http://www.bayview.com/~hermit/
-----------------------------------------------------------------------------
The secret of being creative is making something that's not very new
but just a little bit different in the right direction - Marvin Minsky



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