File Coverage

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   24326 use strict;
  1         3  
  1         52  
4 1     1   5 use warnings;
  1         2  
  1         39  
5              
6 1     1   6 use Exporter 'import';
  1         3  
  1         200  
7             our @EXPORT_OK = qw( is_uuid );
8              
9             our $VERSION = '0.1.0'; # VERSION
10             # ABSTRACT: Data Validator to check for well formed UUIDs
11              
12             sub is_uuid {
13 2     2 1 1818 my $uuid = shift;
14              
15 2         27 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__