almut followed the same suggestion that I had.

I'm not sure I understood what you're looking for; but here is a little program that shows a similar strategy to almut's...I think it is what you were looking for.

#!/usr/bin/perl my %hash; my $rec_format_name = "foo"; my $rec_property = "color"; my $field_number = 3; my $field_property = "length"; $hash{$rec_format_name}{$rec_property}[$field_number]{$field_property} + = 7; my $value = $hash{$rec_format_name}{$rec_property}[$field_number]{$field_prop +erty}; print "\$rec_format_name = $rec_format_name\n"; print "\$rec_property = $rec_property\n"; print "\$field_number = $field_number\n"; print "\$field_property = $field_property\n"; print "-------------------------------------------\n"; print "\$value = $value\n"; exit(0);

When run, here is the output:

$rec_format_name = foo $rec_property = color $field_number = 3 $field_property = length ------------------------------------------- $value = 7

This uses Perl's autovivication to instantiate the initial hash and all of its substructure. Perl takes care of all of the dereferencing for you...so you don't have use all of the embedded curly-braces. In the suggested references/tutorials that mr_mischief offered, it talks about the strategy of doing the dereferencing using the -> syntax and the rules for when you can ommit the ->'s...which allows the syntax that almut suggested and that I have used in the above little script.

ack Albuquerque, NM

In reply to Re^2: double hash, array, and hashed data structure by ack
in thread double hash, array, and hashed data structure by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.