in reply to use of <STDOUT>
#!/usr/bin/perl
use strict;
my $dir;
open(SYS, "pwd |");
while (<SYS>) {$dir=$_; last;}
chomp $dir; print $dir;
Incidentally, if you use my $pid = open(SYS, "pwd |")
you get the process number of "pwd" in a variable.
|
|---|