#!/usr/bin/env perl use 5.012; use warnings; use utf8; our $VERSION = '1.00'; say '# automatically generated by tools/mkcharver'; say '+{'; while (my $line = readline) { $line =~ m{ \A (? [0-9A-F]+) (?: \.\. (? [0-9A-F]+) )? \h+ ; \h+ (? [0-9]+) \. (? [0-9]) }x or next; my $start = hex $+{start}; my $end = defined $+{end} ? hex $+{end} : $start; my $version = $+{major} . $+{minor}; say "(map {\$_ => $version} $start .. $end),"; } say '}'; __END__ =head1 NAME mkcharver - Create Perl include of Unicode character versions =head1 SYNOPSIS mkcharver DerivedAge.txt >unicode-age.inc.pl =head1 AUTHOR Mischa POSLAWSKY =head1 LICENSE Licensed under the GNU Affero General Public License version 3.