There is a reason why Perl does not let you nest if's directly. It is confusing. Perl allows enough cryptic things, but even Larry drew the line at that one.
Create a block for that. They're cheap.
\nunless (-d $foo) {\n mkdir($foo) or die "Cannot mkdir '$foo': $!";\n}\n
Cheers, Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)