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

Thanks, I am still trying to get this fixed based on your recommendations. I will update this thread once I make any progress.

Replies are listed 'Best First'.
Re^3: Issues with Split
by graff (Chancellor) on Jun 14, 2016 at 10:34 UTC
    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; }
      Thanks a lot, this code works. Appreciate your help.