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:58
Subject:
Re: [ID 20000330.052] Use of uninitialized value in concatenation (.)
Message ID:
14564.8781.883348.636513@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";

Many years ago when I started doing Perl I picked up the idea that it
is always more efficient to do double-quote interpolation than
spelling it out with '.' between each element.  Of course, that was in
the days of Perl4.  I assume that is no longer a concern?  Was it
ever, or was I misinformed?  I've done a lot of Perl hacking, but have
never spent time digging around in the actual interpreter itself.

I also was told that if there are no variables to be interpolated to
always use single quotes rather than double quotes, as the extra
parsing required was expensive.  Is/was this true?

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