Thursday, June 21, 2012

What are the various ways to execute external commands in Perl on UNIX?

There are many ways to run external commands from Perl as mentioned below:

system() - you want to execute a command and do not want to capture its output
exec() - you do not want to return to the calling perl script
backticks (``) - you want to capture the output of the command
open() - you want to pipe the command (as input or output) to your perl script

No comments :