use IPC::Run qw( run ); open(my $fh, '>>', '/Volumes/Expansion Drive/stuffTGZ/list_xxx_dirs.txt') or die $!; print($fh "-------------------------------------------------\n"); print($fh "- $File::Find::name -----------------------------\n"); run [ "/bin/ls" => ( "-l", $File::Find::name ) ], '<', \"", '>', $fh;