Your question has been answered, this is my answer to the question
you didn't (directly) ask, how can I easily find all (nonempty) files with a '.wgt' extension in a specified path.
use strict;
use warnings;
use File::Find::Rule;
my $search_path = '.';
my @files = File::Find::Rule
->name('*.wgt')
->file
->nonempty
->in($search_path);
foreach my $file (@files) {
# do something with '$file'
}
The downside is that File::Find::Rule is not a core module yet,
but my opinion is that it should be. Anyway the great power of Perl
stands in the huge library of modules on CPAN.
Regards, Stefan