use strict; my $count=0; my @cp_op = qw(111 222 333); foreach my $line (@cp_op) { #splits each line of the array print "$line\n"; $count ++; } print "$count\n";