lib/DNS/Vi.pm
changeset 63 df6ce1a4c43b
parent 62 aff0448cbef9
child 64 b61e5e1cc7ad
equal deleted inserted replaced
62:aff0448cbef9 63:df6ce1a4c43b
    27     ### @lines
    27     ### @lines
    28 
    28 
    29     my @zone;
    29     my @zone;
    30     my ($origin, $ttl, $last_label, $soa_seen);
    30     my ($origin, $ttl, $last_label, $soa_seen);
    31 
    31 
       
    32     $_ = '';
    32     foreach (@lines) {
    33     foreach (@lines) {
    33         s{;.*$}{};  # strip trailing comments
    34         s{;.*$}{};  # strip trailing comments
       
    35 	state $line;
       
    36 	if (my $range = /(.*)\(\s*$/ .. /(.*)\)\s*/) {
       
    37 	    $line .= defined $1 ? $1 : $_;
       
    38 	    next unless $range =~ /E0$/;
       
    39 	}
       
    40 	if (defined $line) {
       
    41 	    $_ = $line;	# accumulated continuation line
       
    42 	    $line = undef;
       
    43 	}
    34 	s{\s*$}{};  # strip off trailing spaces
    44 	s{\s*$}{};  # strip off trailing spaces
    35         for ($_) {
    45         given ($_) {
    36             when (m{^\s*$})                { next }
    46             when (m{^\s*$})                { next }
    37             when (m{^\s*\$ORIGIN\s+(\S+)}) { $origin = $1 }
    47             when (m{^\s*\$ORIGIN\s+(\S+)}) { $origin = $1 }
    38             when (m{^\s*\$TTL\s+(\S+)})    { $ttl = $1 }
    48             when (m{^\s*\$TTL\s+(\S+)})    { $ttl = $1 }
    39             when (
    49             when (
    40                 m{^(?:(?<label>\S+)(?=\s))?
    50                 m{^(?:(?<label>\S+)(?=\s))?