bluedragon2
IS-IT--Management
I have the following code that will print to the screen, but not to the OUTTEMP file. It creates the file, but will not print to it. Where am I going wrong 
#!/opt/thirdParty/perl/bin/perl
open (IN,"/opt/chknodes/nodelist.txt");
open (OUTTEMP,">/opt/chknodes/alivenodes.out");
foreach $node (<IN>) {
@nodebit = split(/ /,$node);
$p = `ping $nodebit[0]`;
@bits=split(/ /,$p);
if ($bits[0] eq $nodebit[0]) {
print OUTTEMP $nodebit[6];
print $nodebit[6];
}
}
close (OUT);
close(IN);
[Blue]Blue[/Blue] [Dragon]
If I wasn't Blue, I would just be a Dragon...

#!/opt/thirdParty/perl/bin/perl
open (IN,"/opt/chknodes/nodelist.txt");
open (OUTTEMP,">/opt/chknodes/alivenodes.out");
foreach $node (<IN>) {
@nodebit = split(/ /,$node);
$p = `ping $nodebit[0]`;
@bits=split(/ /,$p);
if ($bits[0] eq $nodebit[0]) {
print OUTTEMP $nodebit[6];
print $nodebit[6];
}
}
close (OUT);
close(IN);
[Blue]Blue[/Blue] [Dragon]
If I wasn't Blue, I would just be a Dragon...