![]() |
![]() |
foreachIteration command |
||
Usage | ||
|
||
Description | ||
Executed <command> while assigning to <variable> each <item>. <item> may be a constant, a variable, an array, a dictionary or a function returning either a constant string an array reference or a dictionary reference. If <item> is an array, a dictionary or a function that returns a dictionary or array reference the iteration is done through all the dictionary/array items. Please note that the iteration order of dictionary items is undefined. You can always break from the loop by using the break command. foreach doesn't iterate over empty scalar variables (i.e. the ones set to $nothing) unless you use the -a switch. (Note that an array with *some* empty entries is NOT empty so the iteration is in fact done). |
||
Switches | ||
|
||
Syntax Specification | ||
|
||
Examples | ||
|