Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: using change directory within perl script

by bms (Monk)
on Mar 27, 2012 at 04:11 UTC ( #961825=note: print w/replies, xml ) Need Help??

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/ ...


... 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 is not avaialble at /usr/lib/perl5/5.8.8/File ? Is there any other alternate way to change directory?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://961825]
LanX sighs ... no idea stupid enough
[choroba]: "Smack My Bitch Up" did, though
[Eily]: that's the internet for you LanX
[Eily]: and I'm pretty sure there's a rule somewhere that states that the stupider the idea, the more likely it is to already have been done
zentara is thinking of moving to Mars to esacpe it all
[LanX]: Zentara eq Dr Manhatten ?
[zentara]: more like Dr. Helion3 :-)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2017-03-27 15:21 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.