in reply to Is this a bug or am I insane/stupid/ignorant/etc
print "$host1\n" unless ...
Then think about starting all your programs with 'use strict;' to see about eliminating these kinds of errors.
YuckFoo