Parent Directory | Revision Log
role to implement mkbasepath
1 | dpavlin | 224 | package Frey::Path; |
2 | use Moose::Role; | ||
3 | use File::Path; | ||
4 | |||
5 | =head1 NAME | ||
6 | |||
7 | Frey::Path - path manipulation role | ||
8 | |||
9 | =head2 mkbasepath | ||
10 | |||
11 | $o->mkbasepath('/full/path/with/filename'); | ||
12 | |||
13 | =cut | ||
14 | |||
15 | sub mkbasepath { | ||
16 | my $self = shift; | ||
17 | my $base_path = shift; | ||
18 | $base_path =~ s{/[^/]+$}{}; | ||
19 | mkpath $base_path if ! -e $base_path; | ||
20 | } | ||
21 | |||
22 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |