- 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.
If you have the better answer, then send it to us. We will display your answer after the approval.