Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Issues with Split

by graff (Chancellor)
on Jun 14, 2016 at 10:34 UTC ( #1165545=note: print w/replies, xml ) Need Help??


in reply to Re^2: Issues with Split
in thread Issues with Split

Here is what afoken was talking about -- instead of this:
my ($type, $restofstring) = /^type=(\w+) (.+)$/; for $restofstring (split) { my ($key, $val) = split /=/, $restofstring; $hash{$type}{$key} = $val; }
you should do this:
my ($type, $restofstring) = /^type=(\w+) (.+)$/; for $token ( split ' ', $restofstring ) { my ($key, $val) = split /=/, $token; $hash{$type}{$key} = $val; }

Replies are listed 'Best First'.
Re^4: Issues with Split
by cipher (Acolyte) on Jun 14, 2016 at 11:24 UTC
    Thanks a lot, this code works. Appreciate your help.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2021-02-26 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?