# # $Id: //depot/isms/skulker/cbd/1.1/lib/cbd-util.pl#1 $ # # file: cbd-util.pl # desc: general utilities for CBD processing # # limit scope package CBD::util; # # make directory hierarchy as needed # sub makepath { local($path) = shift; local($mode) = shift; local($newpath) = ''; # assumes '/' as path delimiter foreach $dir (split(/\//, $path)) { $newpath .= "$dir/"; if (! -d $newpath) { mkdir($newpath, $mode); } } } # keep require happy 1; =head1 NAME cbd-util.pl - General utilities for CBD processing =head1 PACKAGE CBD::util =head1 SYNOPSIS require cbd-util.pl =head1 REQUIRES Perl, version 5.001 or higher =head1 DESCRIPTION CBD utilities =over 3 =head1 METHODS =head2 makepath =item * Creates a directory structure specified by the parameter =item example: &CBD::util::makepath("/usr/local/bxxd/blocks/doc.cbd/1999/September"); =back =head1 COPYRIGHT Copyright 1999 Invisible Worlds =head1 AUTHOR CBD::util was written by Gautam Yegnanarayan . =cut