Hi and thanks for playing! :-)
Ok so it would seem (from the output..or lackthereof) of the debugging statements that the loop isn't even being entered. But _why_?
here's the current state of affairs:
#!/usr/bin/perl
#
use strict;
#
#
my $workdir = "$ENV{HOME}/txt";
open (BADIPS), "< $workdir/bad_ips" or die "Couldn't open file: $!";
print "Can you hear me now?\n";
while (my $line = <BADIPS>) {
chomp $line;
print "add ns simpleacl bp-search-spammer DENY -srcIP $line -TTL
+ 43200";
print "Can you hear me now?\n";
}
close BADIPS;
This is what the output looks like:
[bluethundr@lcent5-1:~/perl] $:./bad_ips.pl
Can you hear me now?
And I hear what you're saying about the input file (bad_ips) potentially being empty. But I gotta tell ya, it sure doesn't look that way to me! I am able to open the file and here is the output of ls:
[bluethundr@lcent5-1:~/txt] $:ls -l bad_ips
-rw-r--r-- 1 bluethundr bluethundr 822 Jun 5 04:24 bad_ips
any thoughts? tx again!