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
Why do we use "use strict" in perl?
Elaborate on perl bite-wise operators.
What does next statement do in perl?
Explain the meaning of subroutine?
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,
How will you open a file in a write-only mode in perl?
What are the advantages of perl programming?
How many data types are there in perl?
Explain what is lvalue?
Explain perl. When do you use perl for programming? What are the advantages of programming in perl?
How would you ensure the re-use and maximum readability of your perl code?
What is perl unshift array function?
How do I replace every character in a file with a comma?
Where the command line arguments are stored and if you want to read command-line arguments with Perl, how would you do that?
What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)