in reply to Inserting data into a hash
Well, you're redefining your hash every time you are in the loop, so it's local to the loop. And you're also using a string "key" to be the key. What do you want to be the key? Uip? and the value to be Uuser? If so...
my $hash; while ($WOW =~ m!<table id=.*?table.*?<a href=.*?><b>(.*?)</b></a></sp +an>.*?\(from (.*?)\)!sim) { $Uip = $1; $Uuser = $2; $hash{$Uip} = $Uuser; ... } foreach my $key ( keys %hash ) { print "$key is Uip and $hash{$key} is Uuser\n"; }
--------------
"But what of all those sweet words you spoke in private?"
"Oh that's just what we call pillow talk, baby, that's all."
"But what of all those sweet words you spoke in private?"
"Oh that's just what we call pillow talk, baby, that's all."
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Inserting data into a hash
by ghettofinger (Monk) on Apr 15, 2005 at 17:22 UTC |
In Section
Seekers of Perl Wisdom