Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

file::slurp::withinpolicy(3pm) [debian man page]

File::Slurp::WithinPolicy(3pm)				User Contributed Perl Documentation			    File::Slurp::WithinPolicy(3pm)

NAME
File::Slurp::WithinPolicy - Applies filesystem policies to File::Slurp SYNOPSIS
use File::Slurp::WithinPolicy qw(:all); my $text = read_file( 'filename' ); my @lines = read_file( 'filename' ); write_file( 'filename', $text ); append_file( 'filename', $more_text ); overwrite_file( 'filename', $text ); my @files = read_dir( '/path/to/dir' ); DESCRIPTION
This provides the File::Slurp interface within a policy defined by File::Policy. By default, File::Policy is a no-op and this behaves identically to File::Slurp. System administrators may want to override the default File::Policy implementation to enforce a local filesys- tem policy (see File::Policy). FUNCTIONS
read_dir See "read_dir" in File::Slurp read_file See "read_file" in File::Slurp write_file See "write_file" in File::Slurp append_file See "append_file" in File::Slurp overwrite_file See "overwrite_file" in File::Slurp EXPORTS
By default, nothing is exported. The ":all" tag can be used to export everything. Individual methods can also be exported. SEE ALSO
File::Slurp, File::Policy VERSION
$Revision: 1.4 $ on $Date: 2005/06/15 10:40:21 $ by $Author: simonf $ AUTHOR
John Alden <cpan _at_ bbc _dot_ co _dot_ uk> COPYRIGHT
(c) BBC 2005. This program is free software; you can redistribute it and/or modify it under the GNU GPL. See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt perl v5.8.8 2005-06-15 File::Slurp::WithinPolicy(3pm)

Check Out this Related Man Page

File::Slurp::Unicode(3pm)				User Contributed Perl Documentation				 File::Slurp::Unicode(3pm)

NAME
File::Slurp::Unicode - Reading/Writing of Complete Files with Character Encoding Support SYNOPSIS
use File::Slurp::Unicode; my $text = read_file('filename', encoding => 'utf8'); my @lines = read_file('filename'); # utf8 is assumed if no encoding. write_file('filename', { encoding => 'utf16' }, @lines); # same as File::Slurp::write_file (ie. no encoding): write_file('filename', { encoding => 'binary' }, @lines); use File::Slurp::Unicode qw(slurp); my $text = slurp('filename', encoding => 'latin1'); DESCRIPTION
This module wraps File::Slurp and adds character encoding support through the "encoding" parameter. It exports the same functions which take all the same parameters as File::Slurp. Please see the File::Slurp documentation for basic usage; only the differences are described from here on out. read_file Pass in an argument called "encoding" to change the file encoding. If no argument is passed in, UTF-8 encoding is assumed. The special encoding 'binary' is interpreted to mean that there should be no decoding done to the data after reading it. This is pretty much the same as calling "File::Slurp::read_file()" directly. This option is here only to make code which needs to read both binary and text files look uniform. write_file Pass in an argument called "encoding" to change the file encoding. If no argument is passed in and no wide characters are present in the output data, then no conversion will be done. If there are wide characters in the output data then UTF-8 encoding is assumed. The special encoding 'binary' is interpreted to mean that there should be no encoding done to the data before writing. If you pass a wide string (a string with Perl's internal 'utf8 bit' set) to "write_file" and set the encoding to 'binary' it will die with an appropriate message. This is pretty much the same as calling "File::Slurp::write_file()" directly. This option is here only to make code which needs write both binary and text files look uniform. SEE ALSO
File::Slurp BUGS
None known. Contact author or file a bug report on CPAN if you find any. COPYRIGHT
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Copyright (C) 2010 David Caldwell AUTHOR
David Caldwell <david@porkrind.org> <http://porkrind.org/> PROJECT HOME
<http://github.com/caldwell/File-Slurp-Unicode> perl v5.10.1 2010-10-28 File::Slurp::Unicode(3pm)
Man Page