4 use base qw(Root Read Write);
12 my @files = split /\s+/, $_;
13 $self->add_files(@files);
18 my ($self, @files) = @_;
19 push @{ $self->{__PACKAGE__."files"} }, \@files;
23 my ($self, @list) = @_;
24 if (@list) { return @{ $self->{__PACKAGE__."files"} }[@list] }
25 else { return @{ $self->{__PACKAGE__."files"} } }
30 $self->{__PACKAGE__."offset"} ||= 0;
32 my $files = $self->get_files( $self->{__PACKAGE__."offset"}++ );
33 defined $files or undef $self->{__PACKAGE__."offset"}, return;
43 Filelist - Reads in a list of files.
47 Reads in a file containing a list of files per line and allows you to retrieve them easily.
61 =head2 $list->read($filehandle)
63 Reads in the filelist. Splits the lines in the file on whitespace to find the files.
65 =head2 $list->add_files(@paths);
67 Add your own files to an existing Filelist object.
69 =head2 $list->get_files(@offsets)
71 If @offsets is not an empty list, returns an AoA of the files. Otherwise returns all off the files as an AoA.
73 =head2 $list->all_files()
75 Itterator for retrieving all the files held by the object. Every call returns the files as from get_files() until all of the lines have been gone through, when it returns undef.