Answers

Question and Answer:

  Home  Perl Programming

⟩ How do I do < fill-in-the-blank > for each element in an array?

#!/usr/bin/perl -w

@homeRunHitters = ('McGwire', 'Sosa', 'Maris', 'Ruth');

foreach (@homeRunHitters) {

print "$_ hit a lot of home runs in one yearn";

}

 133 views

More Questions for you: