in reply to Re: how to get all keys of inner hashes
in thread how to get all keys of inner hashes

I don't care about the time, only the files (keys). Should pass an array of files.
  • Comment on Re^2: how to get all keys of inner hashes

Replies are listed 'Best First'.
Re^3: how to get all keys of inner hashes
by poj (Abbot) on Jan 10, 2019 at 17:02 UTC

    Depending on your ultimate goal then maybe a better structure would be

    $newHash{$file}{$dir} = $time;

    or use map

    #!/usr/bin/perl use strict; use List::MoreUtils qw(uniq); use Data::Dump 'pp'; my %files = ( 'ABC' => { 'file1' => 6,'file2' => 5,'file3' => 8, 'file4' => 4, }, 'XYZ' => { 'file2' => 5,'file5' => 6,'file8' => 8, }, ); my @files = uniq map {keys %{$files{$_}}} keys %files; pp \@files;
    poj