编辑代码

use Cwd;
$dir = getcwd();    # Where am I?
print "*$dir*"; 
use Cwd 'chdir';
chdir "/tmp";       # Updates $ENV{PWD}.

use Cwd 'realpath';
$test= realpath("/user");  # prints /var/spool


print "$test";