There's more than one way to do things | |
PerlMonks |
Re: Sifting through firewall rules using a scriptby NetWallah (Canon) |
on Dec 23, 2021 at 02:12 UTC ( [id://11139851]=note: print w/replies, xml ) | Need Help?? |
As GrandFather says - "use strict;" would have told you that you are "chomp"ing the wrong variable name. In addition (besides other minor nits), your regex to match the rules could result in many false positives. I suggest There are also optimizations possible depending on the number of IP addresses. If it is < ~4k, you can combine them into a single regex with alternation, or change which file you choose to read into memory. Feel free to ask specific (properly formatted) questions, using <code> tags for code (Writeup Formatting Tips). "If you had better tools, you could more effectively demonstrate your total incompetence."
In Section
Seekers of Perl Wisdom
|
|