Created
March 25, 2013 13:24
-
-
Save eiro/5237064 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub parse_path (_) { | |
my %data; | |
@data{qw< name path file ext >} = map { | |
$_ | |
, [split m(/)] | |
, m{ | |
( # file | |
[^/]*? | |
( # ext | |
[^.]*?)) $ }x | |
} shift; | |
\%data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use App::Skyfall;
use Test::More;
for (
[ 'prj/data/index.md' =>
{ name => 'prj/data/index.md'
, path => [qw< prj data index.md >]
, file => 'index.md'
, ext => 'md' }
]
) { my ( $path, $expected ) = @$_;
}
done_testing;