basic6 has asked for the
wisdom of the Perl Monks concerning the following question:
I wrote a function that loops through a scalarref line by line in order to make some modifications (in-place), because I was unable to find a Perl feature for that.
So I'd find it interesting if somebody had a simple solution for that trivial task, but my question is:
How could I put this self-made loop (based on a while loop) into a separate package so I can use it to do all kinds of modifications per line?
If that thing was a class, I could instantiate an object but I wouldn't know how to wrap such an object around the individual code which is responsible for the line modifications?