If the input is an array reference, it reduces the array by calling the coderef, in a scalar context, multiple times, setting $a and $b each time. The first call will be with $a and $b set to the first two elements of the list, subsequent calls will be done by setting $a to the result of the previous call and $b to the next element in the list.

Returns the result of the last call to the coderef. If the list is empty then undef is returned. If the list only contains one element then that element is returned and the coderef is not executed.