Try this....
local *CMD;
$cmd = "dir";
open(CMD,"$cmd 2>&1|")|| die "Could not open file handle\n";
while(<CMD>) {
print $_,"\n";
}
close(CMD) || die "Could not close $cmd $!\n";

The program is printing to STDOUT.

--Prasanna

gohaku wrote:

Hi everyone,
After using backticks to retrieve executable output,
I would like to know if there is a backtick alternative.

For example, to get a File Listing on a Unix-based system,
I will do the usual:

$exec = "ls -l";
$src = `$exec`;

Unfortunately, I find the ` to be unreadable and confusing
because it looks like a quote.

Thanks in advance.
-gohaku




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to