Syntactic Confectionery Delight | |
PerlMonks |
Re: Sifting through firewall rules using a scriptby Discipulus (Canon) |
on Dec 23, 2021 at 08:51 UTC ( [id://11139855]=note: print w/replies, xml ) | Need Help?? |
Hello networkdude and welcome to the monastery and to the wonderful world ofperl! Yes, beside strict and warnings (always use it!) I suggest you to adopt the lexical filehandle opening form: open(my $fh, "<", "input.txt") or die "Can't open < input.txt: $!"; Then I suspect that you problem arises in line
because all elements of @IPS end with a \n newline: you can chomp inside the foreach loop too, just before the pattern matching. L* PS as Tux noted you are already chomping, but the wrong array: use strict; use warnings; always :)
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|