| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Unicode::Stringprep::_Common; | 
| 2 |  |  |  |  |  |  |  | 
| 3 |  |  |  |  |  |  | require 5.008_003; | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 11 |  |  | 11 |  | 59 | use strict; | 
|  | 11 |  |  |  |  | 141 |  | 
|  | 11 |  |  |  |  | 371 |  | 
| 6 | 11 |  |  | 11 |  | 50 | use utf8; | 
|  | 11 |  |  |  |  | 19 |  | 
|  | 11 |  |  |  |  | 55 |  | 
| 7 | 11 |  |  | 11 |  | 248 | use warnings; | 
|  | 11 |  |  |  |  | 17 |  | 
|  | 11 |  |  |  |  | 310 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 | 11 |  |  | 11 |  | 59 | use Exporter; | 
|  | 11 |  |  |  |  | 24 |  | 
|  | 11 |  |  |  |  | 6522 |  | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | our $VERSION = "1.10"; | 
| 12 |  |  |  |  |  |  | $VERSION = eval { $VERSION }; | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | our @ISA = ('Exporter'); | 
| 15 |  |  |  |  |  |  | our @EXPORT = ('_mk_set', '_mk_map'); | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | sub _mk_set { | 
| 18 | 154 |  |  | 154 |  | 254 | my @data = (); | 
| 19 | 154 |  |  |  |  | 2342 | foreach my $line (split /\n/, shift) { | 
| 20 | 9581 |  |  |  |  | 16279 | my($from,$comment) = split /;/, $line; | 
| 21 | 9581 |  |  |  |  | 34968 | $from =~ s/[^0-9A-Z-]//gi; | 
| 22 | 9581 |  |  |  |  | 21499 | ($from,my $to) = split(/-/, $from, 2); | 
| 23 | 9581 | 100 |  |  |  | 24820 | push @data, (hex($from), ($to ? hex($to) : undef)); | 
| 24 |  |  |  |  |  |  | } | 
| 25 | 154 |  |  |  |  | 4136446 | return @data; | 
| 26 |  |  |  |  |  |  | }; | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  | sub _mk_map { | 
| 29 | 33 |  |  | 33 |  | 78 | my @data = (); | 
| 30 | 33 |  |  |  |  | 6307 | foreach my $line (split /\n/, shift) { | 
| 31 | 24596 |  |  |  |  | 57716 | my($from,$to,$comment) = split /;/, $line; | 
| 32 | 24596 |  |  |  |  | 87465 | $from =~ s/[^0-9A-F]//gi; | 
| 33 | 24596 |  |  |  |  | 33202 | $to =~ s/[^0-9A-F ]//gi; | 
| 34 | 27698 | 50 |  |  |  | 99799 | push @data, | 
| 35 |  |  |  |  |  |  | hex($from), | 
| 36 |  |  |  |  |  |  | join('',map { | 
| 37 | 24596 |  |  |  |  | 44330 | $_ eq '' | 
| 38 |  |  |  |  |  |  | ? '' | 
| 39 |  |  |  |  |  |  | : chr(hex($_)) | 
| 40 |  |  |  |  |  |  | } | 
| 41 |  |  |  |  |  |  | split(' ', $to)); | 
| 42 |  |  |  |  |  |  | } | 
| 43 | 33 |  |  |  |  | 20131 | return @data; | 
| 44 |  |  |  |  |  |  | }; | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | 1; | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | =head1 NAME | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  | Unicode::Stringprep::_Common - Internal functions for C | 
| 51 |  |  |  |  |  |  |  | 
| 52 |  |  |  |  |  |  | =head1 AUTHOR | 
| 53 |  |  |  |  |  |  |  | 
| 54 |  |  |  |  |  |  | Claus FErber ECFAERBER@cpan.orgE | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | =head1 LICENSE | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | Copyright 2007-2009 Claus FErber. All rights reserved. | 
| 59 |  |  |  |  |  |  |  | 
| 60 |  |  |  |  |  |  | This library is free software; you can redistribute it and/or | 
| 61 |  |  |  |  |  |  | modify it under the same terms as Perl itself. |