Thanks, ikegami & jZed. The one I was trying at the time did have a hostname, so it wasn't that which was causing my immediate problem. However, once I applied the fix suggested by syphilis, I was no longer getting the undefined message. Then I did a range, and sure enough, as soon as I hit an address that didn't have a name, the undefined message came back. I applied a version of your '$ip = "no name" unless' fix, and now that part is working just great!
--Dave