in reply to Question on loops and variables
1. line 15 of your code if(-e "$hostip"){ That is a file test operator that see if a file "$hostip" exists in the current working directory. Then your code goes on to open some other file. Is this file test what you intended to do?
2. The most common cause of "uninitialized value" is a blank line in the input file. Add a print "input=>$_"; line in your while loop to see what each line actually is that is being read. I usually add a "next if /^\s*$/;" to skip blank lines.
3. I see the path: C:/Perl64 That is the default installation directory for 64 bit Active Perl. I may not be understanding what you have - I don't see how C:/perl64/nagios/hosts/ is an Active State created directory or file. But I strongly recommend that you not write any of your own data in C:/Perl64 or anything underneath it. I would consider that whole directory structure as "belonging" to ActiveState.
|
|---|