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
You want to add two arrays together. How would you do that?
What are the features of perl language?
What does cgi program store?
Write syntax to use grep function?
What is the closure in PERL?
How are parameters passed to subroutines in perl?
How do you you check the return code of a command in perl?
What happens in dereferencing?
List the data types that Perl can handle?
Explain ivalue in perl?
Why do we use "use strict" in perl?
How to read multi lines from a file in perl?
Explain regular expression in perl?
How to open and read data files with Perl
Explain goto expr?