blib/lib/Perlmazing/Perlmazing/splitdir.pm untested

filter: Statementstmt 0.0% 0 / 12 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 33 CC 3 SCAR 20.8
CC
3
Cov
0%
main
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 8.0
1 use File::Spec ();
2 require File::Spec::Win32;
3  
4 sub main {
5 my $path = shift;
6 # A little hack is needed for UNC paths under File::Spec
7 my $is_unc = $path =~ /^\\\\/ ? 1 : 0;
8 my @items = File::Spec::Win32->splitdir($path);
9 if ($is_unc and @items >= 3 and length($items[0]) == 0 and length($items[1]) == 0) {
10 @items = ('\\\\'.$items[2], @items[3..$#items]);
11 }
12 @items;
13 }
14  
15 1;