Perl Monk, Perl Meditation | |
PerlMonks |
Re: hey monksby rjt (Curate) |
on Apr 24, 2014 at 19:10 UTC ( [id://1083673]=note: print w/replies, xml ) | Need Help?? |
It's not exactly clear what you're asking. First, please see How do I post a question effectively? and, "hey monks": How do I compose an effective node title? In general terms, however, there are numerous ways to do what you ask. Consider this example:
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.
In Section
Seekers of Perl Wisdom
|
|