How to change a directory on windows via perl script

How to change a directory on windows via perl script.

I wanna mount a share on windows via perl script.

I have used:-

system("dir");

gives the list of directories in the drive i am.This command works well.

Now i want to move from c drive to z drive via perl script.I am using:-

system("chdir /D z:");

also tried---
system("z:");
`z:`

but no success...

can some one help me please?????

What happens if you use Perl's built-in chdir function?
See how to change working directories in perl?

I did it friends....

chdir('C:\test_directory');
system('md newdirectory');
system('dir');

it worked...