#!/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.
In reply to Re: use of <STDOUT>
by halfcountplus
in thread use of <STDOUT>
by PerlZealot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |