programming-examples/perl/Statement/Use for loop to output the element one by one in an array.pl

5 lines
140 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
@array = ("one", "two", "three");
for ($loop_index = 0; $loop_index <= $#array; $loop_index++) {
print $array[$loop_index] . " ";
}