#!/usr/bin/perl -w use strict; ... my @thescore = (); #declare and initialize the array if ( $score > 12 ) && ( $score < 100 ){ push @thescore, $_}; ... } #### foreach (@thescore) { print "$_\n"; } #### foreach my $thescore(@thescore) { print "$thescore\n"; }