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 / mahendra ratnakar

Technically, there's no difference between for and foreach
other than some style issues.

One is an alias of another. You can do things like this

foreach (my $i = 0; $i < 3; ++$i)

{ # normally this is foreach print $i, "n";}


for my $i (0 .. 2)

{ # normally this is for print $i, "n";}


- exec runs the given process, switches to its name and
never returns while system forks off the given process,
waits for it to complete and then returns.

Is This Answer Correct ?    12 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are prefix dereferencer? List them.

976


How will you access an element of a perl array?

945


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

1009


What are the various uses of perl?

1037


What does init 5 and init 0 do?

1015


How can you create anonymous subroutines?

922


What are the benefits of perl in using it as a web-based application?

903


What can be done for efficient parameter passing in perl?

895


Define operators used in perl?

940


Write a cgi program to show the header part?

979


What are the reasons that cookie server can’t handle multiple connections?

948


How do I sort a hash by the hash key?

920


How do I pass a command line argument in perl?

978


What are the various flags/arguments that can be used while executing a perl program?

903


What is the importance of perl warnings?

1144