$ENV{PATH}=''; $ENV{IFS}=''; #### open LS, qq(/bin/ls -al|) || die qq(cannot execute /bin/ls: $!); while () { # Do whatever you want to do with STDOUT from # the ls call here } close LS;