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

Answer Posted / satish kumar golukonda

for and foreach works alike.
But for uses condition expression, where as foreach works on
ranges, contineous indexing.

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use "use strict" in perl?

546


Elaborate on perl bite-wise operators.

532


What does next statement do in perl?

585


Explain the meaning of subroutine?

524


package MYCALC; use Exporter; our @EXPORT = (); our @ISA = qw(Exporter); our @EXPORT_OK = qw(addition multi); our %EXPORT_TAGS = (DEFAULT => [qw(&addition)],Both => [qw(&addition & +multi)]); sub addition { return $_[0] + $_[1]; } sub multi { return $_[0] * $_[1]; } 1; Program: use strict; use warnings; my @list = qw (2 2); use Module qw(:DEFAULT); print addition(@list),"\n"; Above coding is my module MYCALC and the program which using this module, I have not exported any function using @EXPORT, but I have used the DEFAULT in %EXPORT_TAGS with the function addition, when I call this function from the main it says the error as,

2273






How will you open a file in a write-only mode in perl?

486


What are the advantages of perl programming?

542


How many data types are there in perl?

542


Explain what is lvalue?

611


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

476


How would you ensure the re-use and maximum readability of your perl code?

528


What is perl unshift array function?

523


How do I replace every character in a file with a comma?

537


Where the command line arguments are stored and if you want to read command-line arguments with Perl, how would you do that?

694


What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)

549