The revised getPortNames code did not work properly for stacked or chassis based switches.  I rewrote the logic and simplified it, and added comments.  Also changed variable $mib to $oid to correctly identify what we are capturing.  Tested against stacked 3750-X.