CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
change directory when exiting perl


New User

Jan 19, 2010, 6:53 AM

Post #1 of 2 (623 views)
change directory when exiting perl Can't Post

I have written a perl script to navigate a UNIX file system. When the script exits you are left in the directory you started the script in. I would like to have the script leave me in the directory I navigate to when exiting. Any suggestions?


Jan 19, 2010, 11:09 AM

Post #2 of 2 (618 views)
Re: [BTeal] change directory when exiting perl [In reply to] Can't Post

In UNIX, each process is forked from their parent and inherits their environment. After that, they are independent. Any changes in either does not effect the other. To get a child process to run in the parent, you must . or source it. See `man bash` and search for /source/


I love Perl; it's the only language where you can bless your thingy.

Perl documentation is available at The list of standard modules and pragmatics is available in perlmodlib.

Get Markup Help. Please note the markup tag of "code".


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives