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

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

Thread Previous | Thread Next
From:
hermit
Date:
March 30, 2000 19:55
Subject:
Re: [ID 20000330.052] Use of uninitialized value in concatenation (.)
Message ID:
14564.8627.980954.309211@komodo.bayview.com
Tom Christiansen writes:
 > >This is a bug report for perl from hermit@komodo.bayview.com,
 > >generated with the help of perlbug 1.28 running under perl v5.6.0.
 > 
 > >-----------------------------------------------------------------
 > >The warning message that appears when you use an uninitialized variable
 > >in string interpolation (double quotes) is wrong.  It says "Use of
 > >uninitialized value in concatenation (.)" when in fact there is no
 > >concatenation (.) operator on that line.  Instead, there is double-quoted
 > >string interpolation.  The warning message is misleading, as novice
 > >users might go looking for a concatenation operator (a .  between two
 > >scalar values) when in fact the problem is with something different.
 > 
 > 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";

I assumed as much, but I still don't think it's reasonable to expect
the user to know that.

--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

Thread Previous | Thread Next


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