Commit 0512e658 authored by Bernard Quatermass's avatar Bernard Quatermass

Add basename_list() and fullname_list() shortcuts, correct doc typos

parent d3f61fe2
......@@ -6,7 +6,7 @@ use strict;
package File::DirScan;
$File::DirScan::VERSION='1.11';
$File::DirScan::VERSION='1.12';
use Class::Accessorize;
use base qw(Class::Accessorize);
......@@ -224,6 +224,28 @@ relative_list
return wantarray ? @l : \@l;
}
sub
fullname_list
{
my $self = shift;
my $save = $self->fullnames;
$self->fullnames(1);
my @l = $self->list;
$self->fullnames($save);
return wantarray ? @l : \@l;
}
sub
basename_list
{
my $self = shift;
my $save = $self->fullnames;
$self->fullnames(0);
my @l = $self->list;
$self->fullnames($save);
return wantarray ? @l : \@l;
}
sub
list
{
......@@ -318,7 +340,7 @@ version 1.11
=head1 SYNOPSIS
$dscan = File::DirInfo->new;
$dscan = File::DirScan->new;
# Set the directory pathname
$dscan->directory( $path );
......@@ -336,7 +358,7 @@ version 1.11
# Alternate version of the above using initializer defaults
$dscan = File::DirInfo->new( {
$dscan = File::DirScan->new( {
'directory' => $rel_path,
'directories' => 1,
'files' => 0,
......@@ -347,7 +369,7 @@ version 1.11
# Default initialisation is equivalent to
$dscan = File::DirInfo->new( {
$dscan = File::DirScan->new( {
{
'directory' => undef,
'pattern' => '.*',
......@@ -422,6 +444,16 @@ a list or list reference according to context.
Return the current list with the C<relative_path> as the
the prefix. Temporarily overrides the C<fullnames> option.
=item fullname_list
Return the current list with just the fullnames.
Temporarily overrides the C<fullnames> option.
=item basename_list
Return the current list with just the basenames.
Temporarily overrides the C<fullnames> option.
=item subdirectory_list
Return a list (or reference to a list) of B<File::DirScan> objects
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment