Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: splitting headache

by Caillte (Friar)
on Feb 26, 2002 at 14:01 UTC ( #147564=note: print w/ replies, xml ) Need Help??


in reply to splitting headache

A very quick and dirty way of doing this would be:

$line = "Pugh.Pugh.Barney.McGrew.Cuthbert.Dibble.Grub"; $line =~ s/\./\n/g; $line =~ s/([^\n]*)\n/$1./; print $line;

This page is intentionally left justified.


Comment on Re: splitting headache
Download Code
Replies are listed 'Best First'.
Re: Re: splitting headache
by Wibble (Beadle) on Feb 26, 2002 at 14:41 UTC
    Thanks for the reply. I guess I should have explained that my "Pugh.Pugh.Barney.McGrew.Cuthbert.Dibble.Grub" string was just an example of a typical string that might occur. The 'word.groupings' could actually come anywhere, not just at the start, so this method also won't work for me. Thanks again though.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (17)
As of 2015-07-28 18:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls