| 1 | package Cantella::Store::UUID::Util; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | ▶ | use Sub::Exporter -setup => { exports => [ '_mkdirs' ] }; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 2 | our $VERSION = '0.003003'; | |||||||||
| 9 | |||||||||||
| 10 | 17 | ▶ | sub _mkdirs { | ||||||||
|
Subroutine
_mkdirs: called CC=5 SCAR=16.8
| |||||||||||
| 11 | 17 | my $dir = shift; | |||||||||
| 12 | 17 | my $levels = shift; | |||||||||
| 13 | |||||||||||
| 14 | 17 | --$levels; | |||||||||
| 15 | 17 | for my $node ( (0..9), qw(A B C D E F) ){ | |||||||||
| 16 | 272 | my $subdir = $dir->subdir($node); | |||||||||
| 17 | 272 | ▶ | if( -f $subdir ){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 0 | die("Can't create dir '${subdir}': a file with a conflicting name exists"); | |||||||||
| 19 | } | ||||||||||
| 20 | 272 | ▶ | if( ! $subdir->mkpath ){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 0 | die("Can't create dir '${subdir}': $!"); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 272 | ▶ | _mkdirs($subdir, $levels) if $levels > 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | } | ||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 2 | 1; | |||||||||
| 29 | |||||||||||
| 30 | __END__; | ||||||||||