Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
XP is just a number
 
PerlMonks  

Re: split and join

by Anonymous Monk
on Jan 03, 2002 at 22:52 UTC ( [id://136150]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to split and join

just wondering if u had

$line="Bart Lisa Maggie Marge Homer blah blah"; @simpsons=split(/\s+/, $line);

what i wanted is to split so as to get

@simpsons = {"Bart", "Lisa", "Maggie", "Marge", "Homer blah blah"}

notice the last part i want it all attached. Assume i dont know how many "blah"s follow after "Homer".

Edit: g0n - code tags & formatting

Replies are listed 'Best First'.
Re: Re: split and join
by Anonymous Monk on Sep 24, 2002 at 22:28 UTC
    Simple. Use a counter to find the numbers of the Caps in the string and then do..while op until you reach that number.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://136150]
help
Sections?
Information?
Find Nodes?
Leftovers?
    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.