|P is for Practical|
Re^2: How to push the previous line based on the current line to two different files.by GrandFather (Sage)
|on Sep 14, 2012 at 01:05 UTC||Need Help??|
Avoid needless slurping. Use while (<DATA>) instead of introducing an extra variable, slurping into it and using a for loop.
Slurping complicates the code (there are more moving parts), it doesn't scale well, it obscures the intent of the code because it decouples line reading from line processing, and it probably doesn't offer any useful efficiency gains (which shouldn't be a consideration in the first place).
You code could be "cleaned up" as:
True laziness is hard work