#!c:\perl\bin\perl -w use strict; use File::Find; my $inputDir = $ARGV[0]; find {wanted => \&action, no_chdir => 1}, $inputDir; exit 1; sub action{ next unless m/.txt$/i; my $path = $_; #$File::Find; print "$path\n"; }