in reply to problem in printing the result in the out put file
Are you sure this is your code? $in_file2 isn't defined anywhere. Add use strict; use warnings;, fix the warnings given. Do you really have an and open(OUT, ">>port.txt"); for my $host = ....? You may also want to be careful with the scope of $ip, e.g.
my $ip = 1; my @ip = qw (2 3 4); foreach my $ip (@ip){ print "$ip\n"; } print "$ip\n";
Update: fixed code tag typo, thanks Eily.
|
|---|