Text-Distill
view release on metacpan or search on metacpan
lib/Text/Distill.pm view on Meta::CPAN
my $FullName = ( $Name =~ m:^/: ) ? $Name : # $Name has absolute path
"$Dir/$Name"; # $Name has relative path
$FullName = do{
use bytes; # A-Za-z are case insensitive
lc $FullName;
};
# parse all . and .. in name
my @CleanedSegments;
my @OriginalSegments = split m:/:, $FullName;
for my $Part ( @OriginalSegments ) {
if( $Part eq '.' ) {
# just skip
} elsif( $Part eq '..' ) {
pop @CleanedSegments;
} else {
push @CleanedSegments, $Part;
}
}
( run in 0.571 second using v1.01-cache-2.11-cpan-71847e10f99 )