programming-examples/perl/Statement/Reference array length in for loop.pl

11 lines
188 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl -w
use strict;
my @names = qw(A B C D);
print "processing using a for loop:\n";
for (my $i = 0; $i <= $#names; $i++) {
print " Hello $names[$i]!\n";
}