I apologize if the code in the tip was unclear. Let me see if I can clarify what the code is doing.
The first section creates a "list of lists" or an "array of arrays" if you will. This is only used for testing and would not appear in your normal code. Essentially, you have an array, @lists, which has as its elements anonymous arrays. Each anonymous array contains a list of strings.
For example, $lists[1] would be an anonymous array containing the elements 'Bilbo' and 'Frodo'. The element $lists[1][1] would be 'Frodo'.
Moving on down the code, the for loop simply iterates through the "list of lists" and processes each anonymous array through the EnglishCommas function. The code inside the for loop dereferences the outer part of the lists array and passes each of the anonymous arrays to the function in turn.
Lastly, we have the 'meat' of the code, the body of the EnglishCommas function. First, the routine determines what the separator should be. If any of the elementsof the passed array contain a comma, then the separator should be a semicolon. Otherwise we use a comma as the separator.
Next the routine identifies three special cases. First, if there are no parameters then we simply return an empty string.Second, if there is exactly one parameter the return value is simply that single parameter. Lastly, if there are exactly two parameters then the return value is the first parameter, the word ‘and’ and the second parameter.
Having tested for all special cases, it is now time to process a list with three or more elements. To do this, the routine essentially creates a temporary array to pass to the internal function ‘join’. This temporary array is all the elements of the array except the last one, plus the string ‘and ’ prepended to the last element. The join function then inserts the predetermined separator between all its paramete