Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi
@ex_array = qw(sample1:3,4,5 sample2:5,7,8 sample3 sample4:6,9,0)
foreach $sy (@ex_arrya) { %cp_samp=map {$_} split/:/, $sy; }
Well, how do i split the comma separated values and store it as separate hash values, so i'll be able to access them separately ?
$cp_samp{sample1}{first}=3 $cp_samp{sample1}{second}=4 ..
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: create hash with map
by ikegami (Patriarch) on Sep 24, 2007 at 08:34 UTC | |
by Anonymous Monk on Sep 24, 2007 at 09:07 UTC | |
|
Re: create hash with map
by mwah (Hermit) on Sep 24, 2007 at 14:59 UTC | |
by ikegami (Patriarch) on Sep 24, 2007 at 15:39 UTC | |
by mwah (Hermit) on Sep 24, 2007 at 15:49 UTC | |
by ikegami (Patriarch) on Sep 24, 2007 at 15:55 UTC | |
by mwah (Hermit) on Sep 24, 2007 at 16:10 UTC | |
by ikegami (Patriarch) on Sep 24, 2007 at 16:19 UTC | |
|