in reply to recursive mkdir

Those other monk's responses notwithstanding (see tye's recursion link for an in-depth discussion) if you did want to go this route (as a learning experience or something) your's is not so bad a stab at it. You might want to look up merlyn's discussions of '.*' (perhaps
my ($parent) = $path =~ /([^\/]*)\//;
?) and don't you want to check the internal return of my_mkdir()? Hmm, maybe not, save for debug/error msging.

Yoiks! I'm completely backwards here - You want to be greedy. Dang recursion!Forget I mentioned it,... look, out that window, why it's Supermunk! (slinks quietly away to chop onions).

a

Replies are listed 'Best First'.
Re: Re: recursive mkdir
by chipmunk (Parson) on Jan 08, 2001 at 10:35 UTC
    Heh. The .* is correct here. The first call to my_mkdir matches all the parent directories, and each subsequent recursive call matches one fewer parent directory.
Re: Re: recursive mkdir
by zzspectrez (Hermit) on Jan 08, 2001 at 11:02 UTC

    I believe Im dealing with the return's properly. I want my routine to respond just like mkdir. Return 1 if succesfful and 0 if error and the error from mkdir still in $!.

    Correct me if I got it wrong. Seems to test out right

    zzspectrez