[Pdx-pm] mkdir -p ?
Michael G Schwern
schwern at pobox.com
Fri Aug 24 17:35:53 PDT 2007
Austin Schutz wrote:
>> Which would you rather work with?
>>
>> use File::Path;
>> mkpath($path) or die "Can't mkpath $path";
>>
>> Or
>>
>> # Calling system() as a list at least avoids the shell.
>> unless( system("/bin/mkdir", "-p", $path) == 0 ) {
>> die "Can't mkdir -p $path";
>> }
>
>
> Actually I'd rather use the second, given that mkpath will die
> on failure, so your error message will fail.
Oh, well that's just hateful.
--
Whip me, beat me, make my code compatible with VMS!
More information about the Pdx-pm-list
mailing list