Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Connector::Builtin::FiUserPContributed Perl DConnector::Builtin::File::Path(3)

Name
       Connector::Builtin::File::Path

Description
       Highly configurable file	writter/reader.

Parameters
       LOCATION
	   The base directory where the	files are located. This	parameter is
	   mandatory.

       file
	   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.

       content
	   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.

       ifexists
	   o append: opens the file for	appending write.

	   o fail: call	"die"

	   o silent: fail silently.

	   o replace: replace the file with the	new content.

Supported Methods
   set
       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.

   get
       Fetch data from a file. See the file parameter how to control the
       filename.

	   my $data = $conn->set('filename');

Example
	   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.

POD ERRORS
       Hey! The	above document had some	coding errors, which are explained
       below:

       Around line 217:
	   You forgot a	'=back'	before '=head1'

perl v5.24.1			  2016-09-23 Connector::Builtin::File::Path(3)

Name | Description | Parameters | Supported Methods | Example | POD ERRORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Connector::Builtin::File::Path&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help