in reply to Re: Epoch get all files with same day
in thread Epoch get all files with same day
Here you go
#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw' dd '; my %Turtles = ...; # Find "%seen" in perlfaq4/How can I get the unique keys from two hash +es? my %buckets; while( my( $name, $epoch ) = each %Turtles ) { my $ymd = POSIX::strftime('%Y-%m-%d', gmtime( $epoch ) ); push @{ $buckets{ $ymd } }, $name; } dd \%buckets; __END__ { "2012-08-09" => ["B1", "B2"], "2012-08-11" => ["C1", "C2"], "2012-08-13" => ["D1", "D2"], "2012-08-15" => ["A1", "A2"], }
|
|---|