qr/^((\d{1,3}\.){3}\d{1,3})/m
The problem there is that you have two sets of capturing parentheses. You can change the inner capturing parentheses to non-capturing parentheses:
qr/^((?:\d{1,3}\.){3}\d{1,3})/m
And you could change the foreach loop:
foreach ( $response->content =~ /$regex/g ) { @sys = (qw(ipset add), "temp_$set_name", $_); system(@sys) == 0 or die "Unable to add $_ to temp_$set_na +me because: $?"; }
To a while loop that only accesses $1:
while ( $response->content =~ /$regex/g ) { @sys = (qw(ipset add), "temp_$set_name", $1); system(@sys) == 0 or die "Unable to add $_ to temp_$set_na +me because: $?"; }
In reply to Re^5: Create a ipset for blocking networks based on internet sources
by jwkrahn
in thread Create a ipset for blocking networks based on internet sources
by mimosinnet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |