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

Explain chop?

912


What are perl array functions?

1098


How to start perl in interactive mode?

1041


Write a cgi program to show the header part?

968


What can be done for efficient parameter passing in perl?

882


What is the importance of perl warnings? How do you turn them on?

1036


Where do we require ‘chomp’ and what does it mean?

981


How to merge two arrays in perl?

1044


What are the various uses of perl?

1021


What is the difference between single (') and double (") quote in a string in perl?

996


How do you find the length of an array?

968


How many types of variable in perl?

1070


How do you you check the return code of a command in perl?

979


Mention the difference between die and exit in Perl?

1113


Define say() function in perl?

961