Connector::Builtin::File::Path
Highly configurable file writter/reader.
The base directory where the files are located. This parameter is mandatory.
Pattern for Template Toolkit to build the filename. The path components are available in the key ARGS. In set mode the unfiltered data is available in key DATA.
Pattern for Template Toolkit to build the content. The data is passed "as is". If data is a scalar, it is wrapped into a hash using DATA as key.
append: opens the file for appending write.
fail: call die
die
silent: fail silently.
replace: replace the file with the new content.
Write data to a file.
$conn->set('filename', { NAME => 'Oliver', 'ROLE' => 'Administrator' });
See the file parameter how to control the filename. By default, files are silently overwritten if they exist. See the ifexists parameter for an alternative behaviour.
Fetch data from a file. See the file parameter how to control the filename.
my $data = $conn->set('filename');
my $conn = Connector::Builtin::File::Path->new({ LOCATION: /var/data/ file: [% ARGS.0 %].txt content: Hello [% NAME %] }); $conn->set('test', { NAME => 'Oliver' });
Results in a file /var/data/test.txt with the content Hello Oliver.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Connector, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Connector
CPAN shell
perl -MCPAN -e shell install Connector
For more information on module installation, please visit the detailed CPAN module installation guide.