The stupid question is the question not asked | |
PerlMonks |
Re: Adding Pagesby Not_a_Number (Prior) |
on Mar 19, 2014 at 21:06 UTC ( [id://1078990]=note: print w/replies, xml ) | Need Help?? |
Not quite sure what you're trying to do. It would be helpful if you supplied (a small but representative sample of) your input data, and the output that you would expect from this. However, I can tell you that this line: $. % $lines == 0 ? <> : print "\n";is wrong. First, since you have read the whole file into an array (@lines), and then you iterate over this array in a foreach loop, you can't use the input line number ($.). Second, you use a variable $lines, which has not been initialised anywhere in your code. I imagine you mean $viewlines. Update: Corrected typo (s/$!/$./;). Thanks Laurent_R.
In Section
Seekers of Perl Wisdom
|
|