| blib/lib/Data/Validate/UUID.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 11 | 11 | 100.0 |
| branch | n/a | ||
| condition | n/a | ||
| subroutine | 4 | 4 | 100.0 |
| pod | 1 | 1 | 100.0 |
| total | 16 | 16 | 100.0 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package Data::Validate::UUID; | ||||||
| 2 | |||||||
| 3 | 1 | 1 | 19170 | use strict; | |||
| 1 | 1 | ||||||
| 1 | 35 | ||||||
| 4 | 1 | 1 | 4 | use warnings; | |||
| 1 | 1 | ||||||
| 1 | 26 | ||||||
| 5 | |||||||
| 6 | 1 | 1 | 3 | use Exporter 'import'; | |||
| 1 | 2 | ||||||
| 1 | 116 | ||||||
| 7 | our @EXPORT_OK = qw( is_uuid ); | ||||||
| 8 | |||||||
| 9 | our $VERSION = '0.1.1'; # VERSION | ||||||
| 10 | # ABSTRACT: Data Validator to check for well formed UUIDs | ||||||
| 11 | |||||||
| 12 | sub is_uuid { | ||||||
| 13 | 2 | 2 | 1 | 2833 | my $uuid = shift; | ||
| 14 | |||||||
| 15 | 2 | 26 | return ( $uuid =~ /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i ); | ||||
| 16 | } | ||||||
| 17 | |||||||
| 18 | 1; | ||||||
| 19 | |||||||
| 20 | __END__ |