my $Current_Dir = `pwd`; print STDOUT "the current directory is $Current_Dir"; #### open my $output, ">", "$Current_Dir/foo.txt"; #### use Cwd; my $Current_Dir = getcwd; print STDOUT "the current directory is $Current_Dir\n";