Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: split a string at a defined index

by Punitha (Priest)
on Mar 29, 2010 at 05:32 UTC ( #831559=note: print w/replies, xml ) Need Help??


in reply to split a string at a defined index

Hi AvantA,

Try this

$str="www,google,yahoo,345"; my ($var1,$var2)= $str =~/^([^\n]+),([^\n]+)$/;

Punitha

Replies are listed 'Best First'.
Re^2: split a string at a defined index
by smokemachine (Hermit) on Mar 29, 2010 at 10:58 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://831559]
help
Chatterbox?
[zentara]: I'm listening to 20,000 Tibetan monks chant Om Mani Padme Hum
[zentara]: I've decided the first words I will utter when I'm born into that other world..... Hari Om :-)
[LanX]: I forgot my mantra

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2017-05-24 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?