in reply to Re: Writing current working directory to $variablein thread Writing current working directory to $variable
chomp (my $dir = `/bin/pwd`); [download]
-- Randal L. Schwartz, Perl hacker