File-TreeBuilder
view release on metacpan or search on metacpan
lib/File/TreeBuilder.pm view on Meta::CPAN
# ABSTRACT: Build simple trees of files and directories.
# --------------------------------------------------------------------
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(build_tree);
# --------------------------------------------------------------------
sub build_tree {
my ($dir, $str) = @_;
my $caller_pkg = (caller)[0];
$str = q[] unless defined $str;
my @lines = split /\n/, $str;
# Remove blank lines and comments.
@lines = grep ! /^\s*(?:#|$)/, @lines;
my $err_str = q[];
_build_tree($dir, $caller_pkg, \$err_str, @lines);
return $err_str;
}
# --------------------------------------------------------------------
( run in 1.705 second using v1.01-cache-2.11-cpan-1e74a51a04c )