# use File::Find; # open LIST_FH, '>>', '/Volumes/Expansion Drive/stuffTGZ/list_xxx_dirs.txt' or die "Cannot open '/Volumes/Expansion Drive/stuffTGZ/list_xxx_dirs.txt' because: $!"; find( sub { return unless /\.xxx$/; print "$File::Find::name\n"; print LIST_FH "-------------------------------------------------"; print LIST_FH "- $File::Find::name -----------------------------"; open LS_PIPE, '-|', '/bin/ls' ,'-l', $File::Find::name or die "Cannot open pipe from '/bin/ls' because: $!"; print LIST_FH ; close LS_PIPE or warn $! ? "Error closing '/bin/ls' pipe: $!" : "Exit status $? from '/bin/ls'"; }, '.' );