$var = `ls`; print "\n---\n $var \n---\n "; The $var will have the output of 'ls' command.