What is the difference between for & foreach, exec &
system?
Answer Posted / ramesh
Both Perl's exec() function and system() function execute a
system shell command. The big difference is that system()
creates a fork process and waits to see if the command
succeeds or fails - returning a value. exec() does not
return anything, it simply executes the command. Neither of
these commands should be used to capture the output of a
system call. If your goal is to capture output, you should
use the
$result = system(PROGRAM);
exec(PROGRAM);
Is This Answer Correct ? | 12 Yes | 11 No |
Post New Answer View All Answers
What does this symbol mean '->'?
Write a program to decode the data in the form using cgi programming
How to replace perl array elements?
How can I display all array element in which each element will display on next line in perl ?
Write syntax to add two arrays together in perl?
How do I replace every TAB character in a file with a comma?
Explain goto label, goto name, and goto expr?
You want to download the contents of a url with perl. How would you do that?
You want to add two arrays together. How would you do that?
How will you declare a variable in perl?
Explain the default scope of variables in perl?
What does delete function do in perl?
Explain chop?
How can I implement the function overloading in Perl ? I read about the operator overloading, I do not know how to implement the function overloading. Thanks in advance ?
How the interpreter is used in Perl?