in reply to Re: hashes
in thread hashes
actually, for pre-existing hash, i'd combine japhy's with albannach's to get
or i'd make the assignment part of the loop (which i'd change from map to for):%hash = (%hash, (map /(\S+)\s+(.*)/, <FILE>));
... which is what kwolters wanted to avoid.for (<FILE>) {/(\S+)\s+(.*)/ && $hash{$1} = $2}
unfortunately, despite the fact that hashes can be coerced into arrays in most circumstances, you can't push onto them.
caveat: i cut & pasted and was not able to test this. i hate being on the road and having my server go boom. .
.
|
|---|