in reply to system pwd

Don't use system() if you need the output (it grabs the return code!) to be captured in a variable. Use the backticks instead:
my $dir = `pwd`;
Also, but you probably know, you don't need Dumper to print a scalar. ;-)

Michele.