in reply to Finding the current directory

the Cwd module should help.