Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: how to split file with some pattern

by blindluke (Hermit)
on Jan 23, 2015 at 10:49 UTC ( [id://1114264]=note: print w/replies, xml ) Need Help??


in reply to Re^2: how to split file with some pattern
in thread how to split file with some pattern

Good. Now that you have your requirements figured out, try to combine elements of my solution with the suggestions provided by this reply by Discipulus. In particular, ignore the "paragraph mode", start with the while loop suggested by Discipulus, expand the pattern he provided by capturing the desired file name (look at this regexp in my reply: m/^\s*module\s*([A-Za-z]+)/), and finish with writing to files, using either the approach I have show or the one suggested by vinoth.ree.

Try writing your script, and if you encounter any problems, post your code and we will do our best to help you improve it.

- Luke

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2025-12-06 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (85 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.