opensourcer has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
How do i open a new shell from perl script and continue to execute rest of statements without exiting the new shell.
update:
some 1 has written a script(say GCC.pl) which sets up few setenv's and creates a new shell and exists the scripts. now the setenv's are accessible, the another script access those setenv's to run. I want to automate it, so that i don't have to run the first script and then the second i want to add both of them in one. Thanks

Replies are listed 'Best First'.
Re: new shell - perl
by jettero (Monsignor) on May 07, 2008 at 10:51 UTC
    exec bash => '-i' unless fork;

    I don't think it's going to work quite how you want. It depends on what you're up to. If you detailed the actual problem you're trying to solve, there'd be a flood of useful answers.

    -Paul

      some 1 has written a script(say GCC.pl) which sets up few setenv's and creates a new shell and exists the scripts. now the setenv's are accessible, the another script access those setenv's to run. I want to automate it, so that i don't have to run the first script and then the second i want to add both of them in one.
        That looks like a very different question ;-)

        You can just exec 'script2'; At the end of the first script.