If you are going to not even return to the program, exec.

if (condition == true) {
   exec "program";
} else {
   exec "otherprogram";
}

If you want to return to it but not do anything with the programs output,
system.

if (condition == true) {
   system "program";
} else {
   system "otherprogram";
}

If you DO want to keep the output of hte program, backticks.

if (condition == true) {
   my $output = `program`;
} else {
   my $output = `otherprogram`;
}

Hope it helps.

Dennis Stout

----- Original Message -----
From: "Luinrandir Hernsen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 27, 2003 10 07
Subject: question about perl.


How do I run another perl program from within another perl program?

if (x=0)
{
perl_ program_ 1.pl
}
else
{
perl_program_2
}
exit;


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to