timestamps is a hash containing at least one element that is an array reference. The array reference contains 5 elements containing array references. That is a horrible way to describe the structure so lets look at some code ways of dealing with it

use strict; use warnings; my %timestamps = ( x => [ ['2013-08-18T20:43:40Z'], ['2013-08-18T20:43:12Z'], ] ); my $page = 'x'; my @edits = @{$timestamps{$page}}; for my $stamps (@edits) { for my $stamp (@$stamps) { print "a: $stamp\n"; } } print "b: $edits[0][0]\n"; print "b: $edits[1][0]\n"; print "c: $timestamps{x}[0][0]\n"; print "c: $timestamps{x}[1][0]\n";

Prints:

a: 2013-08-18T20:43:40Z a: 2013-08-18T20:43:12Z b: 2013-08-18T20:43:40Z b: 2013-08-18T20:43:12Z c: 2013-08-18T20:43:40Z c: 2013-08-18T20:43:12Z

I've only populated two of the time stamps, but that should serve to see how things hand together. Note the {} to access the hash elements and the [] to access the array elements, and that you can concatenate them as you like for whatever structure you have.

True laziness is hard work

In reply to Re: dereference array by GrandFather
in thread dereference array by natxo

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.