in reply to Re: More efficient way to exclude footers
in thread More efficient way to exclude footers
@array[ length(@array) - $numFooters) ]
But length(@array) returns the length of the string representing the number of elements in the array:
So what you really want is @array[ @array - $numFooters ] (untested). (Also: There's an extra right-paren after $numFooters in the original reply.)c:\@Work\Perl\monks\babysFirstPerl>perl -wMstrict -le "my @array = (0 .. 10_000); print length(@array); " 5
... for the headers, I'm thinking you could just add a variable which keeps track of how many lines you've read in. ... after the header you could first just push every row into an array ... parse only the elements that lead up to @array[ length(@array) - $numFooters) ]
With necessary semantic corrections, isn't this pretty much exactly what Athanasius suggested above?
Give a man a fish: <%-{-{-{-<
|
|---|