Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling another program

Status
Not open for further replies.

BryanY

MIS
Aug 18, 2001
54
US
I was wondering what the best way is to call a perl program from within another perl program.

I basically just want to execute it and test whether it was succesful or returned an error code.
 
Code:
@results=`perl script2.pl`;
foreach(@results) {
  print $_;
}

This is better than a system() call for your purposes because you wish to check the output

HTH
--Paul

cigless ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top