in reply to more with directory contents

Hi, You can filter the ., .. and the scripts name out of the readdir by replacing
my @unsfiles = readdir(DIR);
with
my $filename = __FILE__; my @unsfiles = grep(!/^(\.|$filename)/, readdir(DIR));
provided that none of the other files in the directory start with a dot (.) or your scripts name.
If all your files contain a dot, and the directories not, use the following greps to separate into files and directories:
my @files = grep(/\./, @unsfiles); my @dirs = grep(!/\./, @unsfiles);
Good luck!