my @list = (1, 2, 3, 4, 5); my @result = grep $_ > 2, @list; print "@result"; #### 3 4 5 #### if (exists $item_lookup{$name}){ print qq{$name has $item_lookup{$name}}; else{ print qq{$name is missing $item_lookup{$name}; }