What is the difference between for & foreach, exec &
system?

Answer Posted / ram nivas verma

What is the difference between the 'for' & 'foreach' loops? I know that they can be used interchangeably then what is the purpose of keeping them separate? Can anyone suggest me a good url which can tell the difference between two?

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does next statement do in perl?

580


What is eval function in perl?

552


Mention how many ways you can express string in Perl?

586


What are the advantages and disadvantages of perl language?

482


How to sort arrays in perl?

627






what are the two ways to get private values inside a subroutine or block?

509


Explain USE and REQUIREMENT statements?

561


What is the use of "stderr()"?

571


How many loop control keywords are there in perl?

557


Which guidelines by Perl modules must be followed?

571


There are two types of eval statements i.e. Eval expr and eval block. Explain them.

482


Differentiate between use and require, my and local, for and foreach and exec and system

484


what is perl language?

513


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

548


What are the two ways to get private values inside a subroutine?

454