Use for loop to output all elements in an array : For « Statement « Perl
- Perl
- Statement
- For
Use for loop to output all elements in an array
@array = ("one", "two", "three");
for ($loop_index = 0; $loop_index <= $#array; $loop_index++)
{
print $array[$loop_index] . " ";
}
Related examples in the same category