PostScript-CDCover
view release on metacpan or search on metacpan
lib/PostScript/CDCover.pm view on Meta::CPAN
}
# Add a directory, somewhere in the subtree, i.e., if the new directory is more
# than one level below the current one, the actual addition is delegated to a
# first level subdirectory.
sub add_directory {
my ($self, $path) = @_;
$path =~ s|^[/\\]||;
my ($head, $rest) = split m|[/\\]|, $path, 2;
my $dir = $self->directory($head);
$dir->add_directory($rest) if $rest;
}
# Add a file somewhere in the subtree. If the file does not belong to the
# current directory, the task of adding it is delegated to a subdirectory
# (which, in turn, can delegate to one of its own subdirectories, and so on).
sub add_file {
my ($self, $path) = @_;
$path =~ s|^[/\\]||;
my ($head, $rest) = split m|[/\\]|, $path, 2;
if ( $rest ) {
$self->directory($head)->add_file($rest);
}
else {
push @{$self->{_files}}, $head;
}
}
# Returns a string consisting of all the calls to the Postscript program
# function file_title or folder_title for the current directory.
( run in 0.942 second using v1.01-cache-2.11-cpan-5511b514fd6 )