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

Hi perlmonks,

Is there any module to hold the command line session inside localhost. I am using IPC::Cmd, but unable to hold the previous session. Example:
my( $success, $error_code, $full_buf) = run( command => "cd /home/john +/test", verbose => 0 ); ($success, $error_code, $full_buf) = run( command => "pwd", verbose => + 0 );
While executing the above code, the second line returns '/home/john' instead of '/home/john/test'.
Because, test folder is present in '/home/john'.

Chain of commands in a single run is working but I need to run one after the other based on the output of the first run.
Is there anyother way or Module to handle the above situation
Please help me on this

Replies are listed 'Best First'.
Re: I am unable to execute series of command through IPC::Cmd
by Joost (Canon) on Dec 14, 2006 at 15:18 UTC
      Thank YOU somuch Joost,

      your code helped me a lot and it solved many of our problems.
      Once again Thanks a lot.