in reply to change directory

That's not how the "current directory" works. The "current directory" is a property of the currently running process. If you want to change the current directory of the parent process, you need cooperation of the parent process.

A common approach is to output shell commands from your script and have the shell run these commands:

#!perl -w print "cd ..\n";
> eval "$(myscript.pl)"