http://www.perlmonks.org?node_id=961825


in reply to using change directory within perl script

Why are you using chdir with File::chdir?

Try using it like:

... use File::chdir; $CWD = '/usr/bin'; # Oh hey, in /usr/bin/ ...

Or

... use File::chdir; $CWD = '/home/me/perl'; # Now in /home/me/perl { local $CWD = '/home/you/python'; # Now in /home/you/python ... } # Back in /home/me/perl ...

Hope this helps!

Replies are listed 'Best First'.
Re^2: using change directory within perl script
by Anonymous Monk on Feb 17, 2016 at 23:50 UTC
    What if chdir.pm is not avaialble at /usr/lib/perl5/5.8.8/File ? Is there any other alternate way to change directory?