Create sub directories in Perl

Sometimes you need to create a large tree of subdirectories. But why? Two examples that I think of are structured directories for weblogs, e.g. /[year]/[month]/[day]/, or the automatic backing up of files e.g. invoices/[company]/[year]. Before you begin, you know that using a split and chdir, or some other combination of built-ins, will just make big mess. A call to mkdir -p could also work, but let’s use the available modules this time....

April 7, 2011