more useful options | |
PerlMonks |
Re: Reading CSV Functionby jwkrahn (Abbot) |
on Jun 15, 2021 at 03:39 UTC ( [id://11133878]=note: print w/replies, xml ) | Need Help?? |
@headerArray starts out as a single string (an array of one element). You then assign a reference of that array to $headerArrayRef, which could have been done in one step like this:
Next you convert that reference to a string and assign it to $headingAref. Which means that $headingAref can never access the original data from @headerArray. And finally you dereference a string which is an error and will not work.
In Perl a for (foreach) loop iterates over a list but that is a list of one value (whatever $currentIndex >= $readLineFrom and $currentIndex <= $readLineTo evaluates to). It looks like that should be if instead of for:
Or you could do it the "Perl" way:
In Section
Seekers of Perl Wisdom
|
|