my @arr = (
{
filename => 'foo.txt',
time => time(),
filetype => 'furry',
},
{ filename => 'readme', time => time(), filetype => 'blue' },
);
Now @arr contains references to two hashes, each containing the fields you specified (in lowercase, you can use uppercase if you really want to, but most Perl code wouldn't).
To pull together all files of a specific filetype, you can use this sort of construct:
my @blue_files = grep { $_->{filetype} eq 'blue' } @arr;
And to print the filenames from that:
print "$_->{filename}\n" for @blue_files;
Hopefully these very simple examples will be relevant to you, and will help you grasp some of the basics. Please do make good use of perlintro and the other resources here.
use strict; use warnings; omitted for brevity.
|