Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Split this string

by thargas (Deacon)
on Oct 12, 2011 at 12:59 UTC ( #931003=note: print w/ replies, xml ) Need Help??


in reply to Split this string

Is there a reason for not using the following?

@array = split /\s/, $string, 2;
This will only split on the first whitespace and will ignore any other whitespace. I.E. you'll only get at most two elements from the split.


Comment on Re: Split this string
Download Code
Replies are listed 'Best First'.
Re^2: Split this string
by Anonymous Monk on Oct 12, 2011 at 13:01 UTC
    count the equals signs, that is how many pairs of data exist

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2015-07-08 04:41 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 (94 votes), past polls