chdir '/tmp' or die $!;
#!/usr/bin/perl use Cwd; chdir 'tmp' or die $!; my $wd=Cwd::getcwd(); print "$wd"