A type of loopstatement in programming that performs pre-defined tasks while or until a pre-determined condition is met. For example, in Perl you may use a foreach loop similar to the below example that goes through each of the elements of an array, printing everything in the array.