in reply to getting syntex error in pattern search
Please, format your post question effectively
Even when that is done. There are other some other best practice I think you should still look into.
... while(<$fh>){ chomp; (my $ip = $_) =~ m/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/; print $ip,$/; } ...
... while (<$fh>) { chomp; my $ip=""; if (m/(?<matched_ip>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))/){ $ip = $+{matched_ip}; } print $ip,$/; } ...
|
|---|