Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Inserting data into a hash

by RazorbladeBidet (Friar)
on Apr 15, 2005 at 17:00 UTC ( [id://448262]=note: print w/replies, xml ) Need Help??


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."

Replies are listed 'Best First'.
Re^2: Inserting data into a hash
by ghettofinger (Monk) on Apr 15, 2005 at 17:22 UTC
    I appreciate your help.
    Thank you very much.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://448262]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-24 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found