my @list= (1,8,3,9,2); my @newlist= grep $_<5, @list; # @newlist would be (1,3,2);