in reply to Pingger

Don't know exactly what your problem is, but if you change the print-line to:
print " $host is alive \n"; it will print:
10.1.1.1 is alive 10.1.1.2 is alive 10.1.1.3 is alive