Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: change directory

by Corion (Patriarch)
on Dec 21, 2016 at 10:35 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-03-29 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found