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
What is the closure in PERL?
What $! In perl?
What are prefix dereferencer? List them.
Is there any way to add two arrays together?
Mention the difference between die and exit in Perl?
What are scalars in perl?
What are the various perl data types based on the context?
What are the different instances used in cgi overhead?
Why do we use "use strict" in perl?
Explain the arguments for perl interpreter.
How to access parameters passed to a subroutine in perl?
What are the arguments and what do they mean in perl programming?
What are the different types of perl operators?
What are the various uses of perl?
What is warn function in perl?