in reply to Re: (bbfu) (eq instead) Re3: Appending an array
in thread Appending an array

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.



If God had meant us to fly, he would *never* have given us the railroads.
    --Michael Flanders