#!/usr/bin/perl use File::Find; $path = '/home/perl'; find(sub{push(@files, $_) unless (-d $_)}, $path); print @files;