/[webpac2]/trunk/lib/WebPAC/Path.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/WebPAC/Path.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1202 - (show annotations)
Fri May 29 18:15:57 2009 UTC (14 years, 10 months ago) by dpavlin
File size: 331 byte(s)
 r1890@llin:  dpavlin | 2009-05-29 20:09:47 +0200
 WebPAC::Path provides mk_base_path helper function

1 package WebPAC::Path;
2
3 use strict;
4 use warnings;
5
6 use Exporter 'import';
7 our @EXPORT = qw/
8 mk_base_path
9 /;
10
11 use File::Path;
12
13 sub mk_base_path {
14 my ($path) = @_;
15
16 my $base_path = $path;
17 $base_path =~ s{/[^/]+$}{};
18
19 if ( ! -e $base_path ) {
20 mkpath $base_path;
21 warn "# created $base_path\n";
22 }
23
24 return -e $base_path;
25 }
26
27 1;

  ViewVC Help
Powered by ViewVC 1.1.26