#!perl -w use strict; my @new = (); get_file($ARGV[0]); sub get_file { my ($dir) = @_; use File::Find; finddepth(\&wanted, $dir); sub wanted { if (-f $_ && -s $_) { my $basename = $_; push @new, $basename; } } open LOG, '>log' or die $!; foreach my $new (@new) { print LOG "$new\n"; } # chmod (0750, "log"); close (LOG); }