in reply to Re^3: Printing files that has two different extensions in a given directory
in thread Printing all the files that have both ".rtf" and ".ftp" by searching recursively in a given directory
use strict; use warnings; use File::Find::Rule qw( ); my %files; for ( File::Find::Rule ->file() ->name('*.rtf', '*.ftp') ->in('.') ) { my ($name) = /^(.*)\./; ++$files_by_ext{$name}; } say for grep {$files{$_} == 2} keys %files;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Printing files that has two different extensions in a given directory
by ikegami (Patriarch) on Apr 12, 2011 at 21:39 UTC | |
by JavaFan (Canon) on Apr 12, 2011 at 22:12 UTC | |
by ikegami (Patriarch) on Apr 12, 2011 at 22:29 UTC | |
by JavaFan (Canon) on Apr 12, 2011 at 22:45 UTC |