Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6987769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:58:55+00:00 2026-05-27T18:58:55+00:00

I dropped the idea of using this for my program, but I am intrigued

  • 0

I dropped the idea of using this for my program, but I am intrigued because I never found the answer to how to do this. Basically, if I construct something like the following (Please forgive my formatting if the following doesn’t appear okay):

  • A = |num_key => hashref_a|,
  • hashref_a is a hash reference to a = |string_keys => hashref_b|,
  • hashref_b is a hash reference to b = |num_key, num_value|.

So as you see, the first level is a hash with keys being numbers and its values are references to another hash, which in turn is a hash whose keys are strings related to values which are again hash references (these are however hashes of just keys and numbers).

Now, how do I access b (the entire list of keys or just the value for a corresponding key) given a num_key for the first hash and a particular string_key for the second hash.

I really hope I was able to communicate the question clearly!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:58:56+00:00Added an answer on May 27, 2026 at 6:58 pm

    If I’ve understood your request correctly:

    my %hash = ( num_key => { string_keys => { num_key => 1.234 } } );
    

    Or:

    my %hash_b = ( num_key => 1.234 );
    my %hash_a = ( string_keys => \%hash_b );
    my %hash_z = ( num_keys => \%hash_a );
    

    Hmmm…after editing the question, I think you’re asking how to access the values, rather than how to construct them.

    my $value = $hash{$num_key}->{$string_key}->{num_key};
    

    It gets a bit iffy here; I’ve used $num_key but the only valid value for that given the data is ‘num_key’; similarly with $string_key and ‘string_keys’. The arrows are the key to the notation, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty sure this is a simple question, but I have no idea where
How can I restore a mysql database that was dropped using a drop database
i have a small program where an element is draged and dropped, when the
A crazy idea just dropped from the sky and hit me in the head
I am exploring the idea of using professionally designed vector images as the ControlTemplates
I got this code working! I have a button inside a my UserControl dropped
Im trying to achieve an inner-shadow effect on a simple box, something like: alt
It seems like it should be a piece of cake but neither Google or
I have a contentEditable element that should accept drag'n drop actions but I'd like
I can't seem to find any tutorial on Google regarding this, but I've seen

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.