in reply to Re^2: how to split based on new line or others ?
in thread how to split based on new line or others ?
bh_perl
The problem is not in splitting but in storing the keys in hash. Hash keys are always unique, but in your case (keys: name and mobile) you are using duplicate keys. So the final key and values are getting printed. If you tell the exact requirement, we can correct you.
Check with the print statements:
foreach (split(/\n/,$data)) { my ($fldname, $fldvalue) = (split(/\:/,$_))[0,1]; print "**$fldname**\t$fldvalue\n"; $fldinfo{$fldname} = $fldvalue; }
Prasad
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: how to split based on new line or others ?
by bh_perl (Monk) on Nov 08, 2006 at 07:41 UTC | |
by prasadbabu (Prior) on Nov 08, 2006 at 09:44 UTC |