If so, then you know wrong. $ matches the end of the string (just after the last character), not the last character itself. (It's also possible that you just phrased it unclearly, but I figure better safe than sorry...)
Aside from that, avoid adding the comma in the first place if possible (probably by using join to buld the string), use s/,$// if not, just like others have said.
In reply to Re: Eliminating last comma
by dsheroh
in thread Eliminating last comma
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |