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 does `$result = f() .. g()' really return?
How to disable the mod_perl from apache_server as i have used perlfect search on the site and its pagination is not working and the remedy is to disable the mod_perl.
Which has the highest precedence, List or Terms? Explain?
What is the function of virtual documents in cgi programs?
What is perl dbi?
what are the strategies followed for multiple form interaction in cgi programs?
Comment on the scope of variables in perl.
Explain split function in perl?
What is 'commit' command in perl?
How will you access an element of a perl array?
What is grep used for in perl?
Can we load binary extension dynamically?
List the files in current directory sorted by size ?
Explain chop?
How to renaming a file in perl programming?