What grep does is go through the list and return a sublist of elements that (in this case) are equal to the element you're about to add. That sublist is then evaluated in boolean context by the unless: if the sublist is empty, it evaluates false, and the push takes place; if it's non-empty (which is to say, if $result appears in @data already), it evaluates true, and the push is stopped.
In effect, the unless grep... means "unless we've already seen this result": it's there to prevent you from adding duplicates to @data. You could filter for it later on, but it'd be a pain, so pre-filtering it makes a lot of sense.
In reply to grep in a conditional
by ChemBoy
in thread Appending an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |