change de current working directory of my session...

Discussion in 'Perl Misc' started by david_cantin@hotmail.com, Jun 9, 2004.

  1. Guest

    Hi,

    Is it possible to run a perl script that change my current "session"
    working dir? Something like a script that a thing like thar :

    $pwd
    /home/foo
    $./perl_script
    $pwd
    /usr/local/bin

    it's dificult because a new process is started when we run a perl
    script, so if the perl script change the cwd, the change will die with
    the script...

    Ps, My os is AIX 4.3 and 5.2


    David
    , Jun 9, 2004
    #1
    1. Advertising

  2. Anno Siegel Guest

    <> wrote in comp.lang.perl.misc:
    > Hi,
    >
    > Is it possible to run a perl script that change my current "session"
    > working dir? Something like a script that a thing like thar :
    >
    > $pwd
    > /home/foo
    > $./perl_script
    > $pwd
    > /usr/local/bin


    No.

    > it's dificult because a new process is started when we run a perl
    > script, so if the perl script change the cwd, the change will die with
    > the script...


    Exactly.

    In most shells this should work:

    eval cd `perl -le 'print "/tmp"'`

    but that's not the Perl program changing the directory for you, but
    it's Perl telling the shell where to change the directory to. It's
    also off topic.

    Anno
    Anno Siegel, Jun 9, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manu
    Replies:
    1
    Views:
    6,084
    Natty Gur
    Jul 20, 2003
  2. Chris Mellon

    2.4->2.5 current directory change?

    Chris Mellon, Feb 26, 2007, in forum: Python
    Replies:
    3
    Views:
    396
    Ziga Seilnacht
    Feb 26, 2007
  3. duyanning
    Replies:
    3
    Views:
    643
    R. Bernstein
    Nov 27, 2007
  4. Replies:
    4
    Views:
    120
    Joe Smith
    Jun 10, 2004
  5. Replies:
    1
    Views:
    110
    Brian McCauley
    Jun 10, 2004
Loading...

Share This Page