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 rules must be followed by modules in perl.
Explain '->' in perl?
explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.
How to create a directory in perl?
Explain the difference between "my" and "local" variable scope declarations. ?
Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)
Why aren't Perl's patterns regular expressions?
What are perl variables?
What are arrays in perl?
How to do comment in perl?
Write a program to decode the data in the form using cgi programming
What does this symbol mean '->'?
how to get back up from private character editor which is saved in the format of .udf
Explain USE and REQUIREMENT statements?
Explain tk?