Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: multiple keys hash with array as a value - loop

by Limbic~Region (Chancellor)
on Dec 08, 2021 at 15:50 UTC ( [id://11139474]=note: print w/replies, xml ) Need Help??


in reply to multiple keys hash with array as a value - loop

grandagent,
You said "but it only give me the first user in the hash" when what you should have said is "it only produces output for user rmdb_dbo". That's because your if condition is only displaying output for that user. Try this to debug:
for my $connection (keys %h) { print "Looking at connection '$connection'\n"; for my $userid (keys %{$h{$connection}}) { print "\tLooking at userid '$userid'\n"; @a_ref = @{$h{$connection}{$userid}}; if(lc($userid) eq "rmdb_dbo") { print @a_ref, if ( $a_ref[1] =~ m/update\s*[table\s*]rmdb_ +dbo./i ); } else { print "Not checking '@a_ref' because user is not 'rmdb_dbo +'\n"; } } }

Cheers - L~R

Replies are listed 'Best First'.
Re^2: multiple keys hash with array as a value - loop
by grandagent (Novice) on Dec 08, 2021 at 20:13 UTC
    My description was a bit confusing I admit. I just used "value1" "value2" as a placeholder. The acutall strings look like this:
    value1 = UID="rmdb_dbo";DBN=234952;... value2 = update rmdb_dbo....

    where value2 can be also "insert/delete ..." and so on (any type of SQL statement)

    rmdb_dbo is the user that can have multiple connections i.e. multiple connection-id's for that particular user

    Cheers

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-24 15:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found