The return value of push is the number of elements in the array (perldoc -f push), so a scalar is assigned to the list @senders. If you want to add the recipients to the senders, try @senders = (@senders, @recipients). The two lists will be flattened. BTW @sender (note the missing 's') in the code looks like a typo waiting for its comment sign to be removed.