Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by marinersk (Priest)
on May 21, 2015 at 18:34 UTC ( #1127379=note: print w/replies, xml ) Need Help??


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 21: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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1127379]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2023-06-09 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (35 votes). Check out past polls.

    Notices?