How to print all the elements of an array in Perl?

This code will print all the elements of the array "@teams":

@teams = (‘cubs’, ‘reds’, ‘yankees’, ‘dodgers’);
foreach (@teams) {
print “$_\n”;
}
 

Search Topics

Popular Posts