#!/local/bin/perl -w

#Example: Finding all elements of an array that pass a test
use strict;

my @array = (50, 10, 24, 8, -2, 45, 90, -1);
my @matching;

my $item;

foreach $item (@array) {
   if($item < 0 ) {
     push( @matching, $item );
   }
}

print "The values less than 0 are @matching\n";



