#!/usr/bin/perl -w

use FileSearch;

my ($pattern, $dirroot);

print "Please specify the filename pattern by means of a regular expression:\n>> ";
chomp($pattern = <STDIN>);
print "Please specify the root of directory tree to be searched:\n>> ";
chomp($dirroot = <STDIN>);

my $searchobj = new FileSearch('PATTERN' => $pattern);
my @result = $searchobj->find($dirroot);

foreach (@result) {
	print $_, " (", (stat($_))[7], " bytes)\n";
}
