Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 ( [id://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?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-07-22 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.