Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Efficiency aside, does this really work? Okay, well, I know the answer: it doesn't. There is no limit on the split, and the delimiter is any {4} lines. So, if my file is 10 lines long, I get two empty strings, then the remaining 2 lines. Infact, you only ever end up with the last X lines of your file (where X = lines % $skip), preceeded with (lines div $skip) empty strings.
I agree that solutions don't always need to be the most efficient, but parsing through the entire file at least three times is O(n) where O(1) is available in a single line of code. In reply to Re^2: Skipping the first 4 lines of a file:: Is there a better way?
by fishbot_v2
|
|