si_lence has asked for the wisdom of the Perl Monks concerning the following question:
use warnings; use strict; my $path="d:/temp/f1/f2/"; my $path_so_far; my @parts = split("/", $path); foreach my $part (@parts) { $path_so_far .= $part ."/"; if ( !(-e $path_so_far) ) { mkdir($path_so_far) || die "not able to mkdir $path_so_far: $! +"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: make directories from path
by borisz (Canon) on Oct 12, 2004 at 14:38 UTC | |
by si_lence (Deacon) on Oct 12, 2004 at 15:00 UTC | |
|
Re: make directories from path
by pizza_milkshake (Monk) on Oct 12, 2004 at 14:46 UTC | |
|
Re: make directories from path
by bpphillips (Friar) on Oct 12, 2004 at 14:47 UTC | |
|
Re: make directories from path
by periapt (Hermit) on Oct 13, 2004 at 12:44 UTC |