in reply to why this code doesnt work?

Cwd can tell you the current directory.
#! /usr/bin/env perl use strict; use warnings; use Cwd 'getcwd'; print "current dir: ", getcwd(), "\n";