in reply to Eliminating last comma

Another option: if the last character is always a comma, then you really just want to remove the last character, which you can easily do with chop($myNames).