Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: What is the difference?by zby (Vicar) |
on Apr 08, 2003 at 14:29 UTC ( [id://248938]=note: print w/replies, xml ) | Need Help?? |
Look at the output without wc. The += operator does not concatenate the right side to the left. It is the .= operator that does it.
Update Ok - there is no wc in the second example. But once again look at the line with += the left side of it is a list - a list does not return its length in a scalar context (only an array do it). Update As Abigail-II pointed out split in scalar context returns the number of fields.
In Section
Seekers of Perl Wisdom
|
|