The stupid question is the question not asked | |
PerlMonks |
Re: Re: What is the difference?by jasonk (Parson) |
on Apr 08, 2003 at 14:30 UTC ( [id://248939]=note: print w/replies, xml ) | Need Help?? |
Split doesn't return a string, it returns a list, the scalar value of which is the number of elements, and since the split is splitting into individual characters, $line (although a poorly chosen variable name) contains the count of all the characters so far. Your 'fixed' example would end up giving you a list of numbers, if the text file contained two lines of 8 characters each, your example would return '88'.
In Section
Seekers of Perl Wisdom
|
|