NAME
App::Followme::EveryFile - Base class for App::Followme classes
SYNOPSIS
use App::Followme::EveryFile;
my $ef = App::Followme::EveryFiles->new();
my ($filenames, $directories) = $ef->visit($top_directory);
foreach my $filename (@$filenames) {
my $page = $ef->read_file($filename);
# other stuff
$ef->write_file($filename, $page);
}
DESCRIPTION
This class contains methods that do the file handling for App::Followme.
- ($filenames, $directories) = $self->visit($top_directory);
-
Return a list of filenames and directories in a directory, The filenames are filtered by the two methods get_included_files and get_excluded_files. By default, it returns all files with the web extension.
- $str = $self->read_page($filename);
-
Read a fie into a string. An the entire file is read from a string, there is no line at a time IO. This is because files are typically small and the parsing done is not line oriented.
- $self->write_page($filename, $str);
-
Write a file from a string. An the entire file is read to or written from a string, there is no line at a time IO. This is because files are typically small and the parsing done is not line oriented.
CONFIGURATION
The following fields in the configuration file are used in this class and every class based on it:
- base_directory
-
The directory the class is invoked from. This controls which files are returned. The default value is the current directory.
- web_extension
-
The extension used by web pages. This controls which files are returned. The default value is 'html'.
LICENSE
Copyright (C) Bernie Simon.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Bernie Simon <bernie.simon@gmail.com>