Question : how do i call one perl program from another perl program

rem **** 3GPP Sensitivity
rem call %aPhong_Root_Dir%\batch\str4500\loadScen3GPPSensitivity-Atlanta.bat
%aPhong_Root_Dir%\dist\simcmd.exe -t30 %aPhong_Sim_IP% 15650 %aPhong_Root_Dir%\config\loadScen3GPPSensitivity-Atlanta.txt
rem after loading the scenario we need to wait for it to stablised.
sleep 15

rem call %aPhong_Root_Dir%\batch\str4500\all130dBmPowLev.bat
%aPhong_Root_Dir%\dist\simcmd.exe -t30 %aPhong_Sim_IP% 15650 %aPhong_Root_Dir%\config\all130dBmPowLev.txt
rem wait for about 3 seconds for the scenario to start running


this is done in a batch file i wana do that for perl thank you

Answer : how do i call one perl program from another perl program

You could start them both from a batch file... via call.

If you need to run it through perl, you could add this to the perl script that calls:

sub run_in_bg {
    my $pid = fork;
    die "Can't fork a new process" unless defined $pid;

    # child gets PID 0
    if ($pid == 0) {
        exec(@_) || die "Can't exec $_[0]";
    }

    # in case you wanted to use waitpid on it
    return $pid;
}

and then add this line to the calling script:

run_in_bg("c:\activeperl\bin\perl.exe", "other_script.pl");
Random Solutions  
 
programming4us programming4us