my $output = `ls -la`; # or open PIPE, "ls -la |"; while() { .... }