programming-examples/perl/Statement/Using foreach to loop through array variable.pl

11 lines
138 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl -w
use strict;
my @array = qw(A B C D);
my $element;
foreach $element (@array) {
print $element, "\n";
}