http://www.perlmonks.org?node_id=1127379


in reply to Re: how to insert new line in text file after regex match?
in thread how to insert new line in text file after regex match?

An interesting approach, Aaron.

Most folks here would make OP show the current code set, to ensure they understood the whole read file/write file process, and that all they were stuck on were particulars of the logic.

You kind of took an interesting middle ground and fed him a complete-from-scratch working example, but he had to at least show enough cleverness to adapt it to his needs.

Not sure it's the middle ground I would have chosen, but it is a creative way to not do absolutely everything for the student.

  • Comment on Re^2: how to insert new line in text file after regex match?

Replies are listed 'Best First'.
Re^3: how to insert new line in text file after regex match?
by aaron_baugher (Curate) on May 21, 2015 at 17:55 UTC

    That's what I was shooting for; didn't know how well I succeeded. We get a lot of questions from people who clearly should still be working through getting a "Hello world!" script working. I figured if he was one of them, my example would be no help to him; but if he had some experience and skill, he'd be okay. It's a hard balance to find, though, between giving a fish and teaching to fish.

    Aaron B.
    Available for small or large Perl jobs and *nix system administration; see my home node.