#!/usr/bin/perl use strict; use warnings; my $_url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"; open(my $file, '>', 'ads.conf') or die "wtfile?"; my $var = `curl $_url` or die "wturl?"; while($var =~ /(\n0\.0\.0\.0)(\s)([\w\.]+?)\s+/g){ print $file "local-zone: \"" . $3 . "\" redirect\nlocal-data: \"" . $3 . " A 0.0.0.0\"\n"; } close $file;