Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to reorder a text file

by Cristoforo (Curate)
on Jun 11, 2018 at 23:43 UTC ( [id://1216446]=note: print w/replies, xml ) Need Help??


in reply to How to reorder a text file

Taken from Re: Split and print hash based on regex
#!/usr/bin/perl use strict; use warnings; open my $fh, '<', \<<EOF; Title 1 Line of text A Line of text B Title 2 Line of text C Title 3 Title 4 Line of text D EOF { local $/; print reverse <$fh> =~ /(^Title(?:(?!^Title).)*)/msg; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (None)
    As of 2024-04-25 01:13 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found