# Get a long directory listing, grep it for files owned by user,
# and write this list to a file named myfiles.txt
$userName = "killbill";
$sysCommand = "ls -l | grep $userName > myfiles.txt";
if ( system($sysCommand) != 0 ){
die "Unable to create file $!";
}