Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Placing text onto multiple lines

by vladb (Vicar)
on May 11, 2003 at 22:31 UTC ( [id://257293]=note: print w/replies, xml ) Need Help??


in reply to Placing text onto multiple lines

This works for me:
use strict; while (<DATA>) { chomp(); my ($first, @rest) = split "<job>"; print "$first<job>$_\n" for @rest; } __DATA__ John Smith 25 May 2003 <job>Manager Clean-up John Smith 25 May 2003 <job>Manager Clean-up <job>Manager Books John Smith 25 May 2003 <job>Manager Clean-up <job>Manager Books <job>M +anager Acounts
And output:
John Smith 25 May 2003 <job>Manager Clean-up John Smith 25 May 2003 <job>Manager Clean-up John Smith 25 May 2003 <job>Manager Books John Smith 25 May 2003 <job>Manager Clean-up John Smith 25 May 2003 <job>Manager Books John Smith 25 May 2003 <job>Manager Acounts


_____________________
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce
the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true."

Robert Wilensky, University of California

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2025-05-16 05:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.