Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Which of these is a difference between Perl and C++ ?

964


Explain perl. When do you use perl for programming? What are the advantages of programming in perl?

824


How to read multi lines from a file in perl?

870


Explain lists ?

881


Why Perl aliases are considered to be faster than references?

896


Mention the difference between die and exit in Perl?

1040


Explain the meaning of closure in perl.

953


What does a die() function do in perl?

931


What is the difference between use and require in perl?

806


How to create a package?

894


Explain the meaning of perl one-liner?

998


What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?

926


What is qq (double q)operator in perl?

965


What are the different ways to run cgi?

908


What does this symbol mean '->'?

916