in reply to get the value from a refernce array of hash

  1. Locate the key that matches the name Feynman.

    my $surname = 'Feynman'; my @matching_ids = grep { $accounts{$_}{surname} eq $surname } keys(%accounts);
  2. Make sure @matching_ids has at least one matching record.

    die("No records matching surname $surname\n") if !@matching_ids;
  3. Handle multiple matches as you see fit.

  4. Get the transactions. They are located in

    @{ $accounts{$id}{transactions} }