Sombrerero_loco has asked for the wisdom of the Perl Monks concerning the following question:
Im seeking for your wisdom!
I need to know how i can push this calue $ServiceRef fomr this piece of code to an array of hash of hashes:As you see im capturing a regex expresion into $serviceref and i want toload every matches has been found into the array into de hash of hashes $index{"ID$counter"}{"sons"}[here should be an array reference, isnt ?].elsif (/<ServiceRef>(.+?)<\/ServiceRef>/) { $serviceref = $1; $index{"ID$counter"}{"sons"} = [$serviceref]; }
As i has wrote its seems doesnt running properly, maybe something its mistakes. I need to do that because i need to keep every matched result of the regex expression because "a father could have more than a son".
Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how can push value from regex to a array of hash of hashes
by ikegami (Patriarch) on Jan 07, 2009 at 14:21 UTC | |
by Sombrerero_loco (Beadle) on Jan 07, 2009 at 14:51 UTC | |
by ikegami (Patriarch) on Jan 07, 2009 at 14:59 UTC | |
by Sombrerero_loco (Beadle) on Jan 07, 2009 at 15:52 UTC |