Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

got a couple questions for ya

is there a way... w/ the mkdir function in perl, that I can tell perl I want to create any parent directories, if needed... so like i don't already have /blah.. and i want to create /blah/blah... it won't do it by default

another thing, say I try to make a directory that is already there.. will that hurt anything? and if so, how do i find out if the directory is already there before I make it?

thanks monks

Replies are listed 'Best First'.
Re: working with directories
by japhy (Canon) on May 25, 2001 at 22:25 UTC
Re: working with directories
by runrig (Abbot) on May 25, 2001 at 22:25 UTC
Re: working with directories
by arturo (Vicar) on May 25, 2001 at 22:36 UTC

    See also the vast range of file test operators Perl provides you with: perldoc -f -X or see the online version on this site here.

    perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'