3 # Courtesy Ken Pizzini.
7 #This file released to the public domain.
9 # Note: error checking is poor; trust the output only if the input
10 # has been checked by zic.
16 while (s/^\s*((?:"[^"]*"|[^\s#])+)//) {
21 my $type = lc($fields[0]);
23 @fields >= 3 or warn "bad continuation line";
24 unshift @fields, '+', $contZone;
29 if ($type eq 'zone') {
30 # Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
31 my $nfields = @fields;
32 $nfields >= 5 or warn "bad zone line";
34 #this splice is optional, depending on one's preference
35 #(one big date-time field, or componentized date and time):
36 splice(@fields, 5, $nfields-5, "@fields[5..$nfields-1]");
38 $contZone = $fields[1] if @fields > 5;
39 } elsif ($type eq 'rule') {
40 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
41 @fields == 10 or warn "bad rule line";
42 } elsif ($type eq 'link') {
43 # Link TARGET LINK-NAME
44 @fields == 3 or warn "bad link line";
45 } elsif ($type eq 'leap') {
46 # Leap YEAR MONTH DAY HH:MM:SS CORR R/S
47 @fields == 7 or warn "bad leap line";
49 warn "Fubar at input line $.: $origline";
51 print join("\t", @fields), "\n";