Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: jbrowseentry using hashref does not seem to work

by flexvault (Monsignor)
on Apr 04, 2016 at 17:31 UTC ( #1159522=note: print w/replies, xml ) Need Help??

in reply to jbrowseentry using hashref does not seem to work


I was hoping a monk with "Tk::JBrowseEntry" experience would give you some help, since I never worked with it, and only played with "Tk" a few times. That said, after you build your '%color_of' hash you could build another hash with the values of '%color_of' as the keys. ie: Untested!

my %color_of = ( "apple" => "red", "orange" => "orange", "grape" => "purple", ); my %rev_color = (); foreach my $key ( keys %color_of ) { $rev_color{ $color_of{ $key } } = $key; }

This allows you to lookup '$value' by using the contents of '$var' as the key for your '%rev_color' hash. ie:

print "Var = $var, Get Result $rev_color{ $var }\n";

Note: you can't have duplicate keys in the new hash.

It may not be perfect, but it's a way of getting your desired results.


"Well done is better than well said." - Benjamin Franklin

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2022-01-21 08:35 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (57 votes). Check out past polls.