Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: change directory

by Corion (Patriarch)
on Dec 21, 2016 at 10:35 UTC ( #1178287=note: print w/replies, xml ) Need Help??


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)"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1178287]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2023-10-02 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?