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 peculiarity of returning values by subroutines in perl?
Which functions in perl allows you to include a module file.
When does circular reference occur?
How can you use Perl warnings and what is the importance to use them?
How does polymorphism work in perl?
Define perl scripting?
Perl regular expressions are greedy" what does this mean?
What is the difference between perl list and perl array?
What is the use of –w?
Write a program that shows the distinction between child and parent process?
How will you open a file in a write-only mode in perl?
What does the qq{ } operator do?
You want to download the contents of a url with perl. How would you do that?
How to sort arrays in perl?
Why to use perl scripting?