Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
hi
what i am trying is to get make a reference of "same_text" with the value assigned to it as the key and values found in the second line as values
while(<LF>){ if ($_ =~ /(same_text\s=\s\d),((\s\S+){1,2})/gi){ ($junk,$ky)=split(/=/,$1); push(@{$hash{$ky}},$2); } }
The above only gets me the first match "same_text = 1, jhhj" and dumps "jhhj" in the hash-array-value. the rest of the matching does not happen
what i need exactly is : A hash of same_text with {1,2,3..} as keys and i get values "sdaj, jsdgd, sksd" for the respective keys
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Repeat match
by siva kumar (Pilgrim) on Jan 30, 2007 at 12:51 UTC | |
by Anonymous Monk on Jan 30, 2007 at 13:16 UTC | |
|
Re: Repeat match
by RMGir (Prior) on Jan 30, 2007 at 13:13 UTC | |
|
Re: Repeat match
by swampyankee (Parson) on Jan 30, 2007 at 13:25 UTC | |
|
Re: Repeat match
by Anonymous Monk on Jan 30, 2007 at 11:44 UTC |