in reply to Re: strange responses to inhouse perl training
in thread strange responses to inhouse perl training
An example for foreach
# Basic example my $sum = 0; foreach my $number (1,2,3,4,5) { $sum = $sum + $number; } # A little better foreach my $number (1..5) { $sum += $number; } # Probably shouldn't show this one $sum += $_ for (1..5);
I would stay away from showing them map or grep initially unless you're dealing with someone with lisp experience.
|
|---|