ghettofinger has asked for the wisdom of the Perl Monks concerning the following question:
I have a really basic question that I have been milling over for a couple of hours now and I thought I had it, but I am not getting the results I wanted. I simply need to create a hash and then add data to it through multiple "while" type loops.
Here is what I have:... and that will print the $hash{key} pairs to the screen, but I don't think it is putting them into a hash called %hash.while ($WOW =~ m!<table id=.*?table.*?<a href=.*?><b>(.*?)</b></a></sp +an>.*?\(from (.*?)\)!sim) { $Uip = $1; $Uuser = $2; my %hash = (key => $Uip); $hash{key} .= $Uuser; print "$hash{key} \n";
I think the code above is messed up. Is there a better way to do this? How do I run through and print out the hash when I am done to validate that it is being popluated?
I appreciate everyone's help.
Many thanks,
ghettofinger
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Inserting data into a hash
by RazorbladeBidet (Friar) on Apr 15, 2005 at 17:00 UTC | |
by ghettofinger (Monk) on Apr 15, 2005 at 17:22 UTC | |
|
Re: Inserting data into a hash
by BUU (Prior) on Apr 15, 2005 at 19:51 UTC | |
by ghettofinger (Monk) on Apr 16, 2005 at 04:02 UTC | |
|
Re: Inserting data into a hash
by gam3 (Curate) on Apr 15, 2005 at 16:59 UTC |