Use Cwd; my $current_dir = cwd(); print "The current working directory is $current_dir\n";