No::Worries::File man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

No::Worries::File(3)  User Contributed Perl Documentation No::Worries::File(3)

NAME
       No::Worries::File - file handling without worries

SYNOPSIS
	 use No::Worries::File qw(file_read file_write);

	 # read a file
	 $data = file_read($path);

	 # idem but with data returned by reference
	 file_read($path, data => \$data);

	 # write a file
	 file_write($path, data => "hello world");

	 # idem but with data passed by reference
	 file_write($path, data => \"hello world");

DESCRIPTION
       This module eases file handling by providing convenient wrappers around
       standard file functions. All the functions die() on error.

FUNCTIONS
       This module provides the following functions (none of them being
       exported by default):

       file_read(PATH[, OPTIONS])
	   read the file at the given path and return its contents; supported
	   options:

	   ·   "binmode": binary mode to use (see below)

	   ·   "bufsize": buffer size to use for I/O operations

	   ·   "data": return the file contents via this scalar reference or
	       code reference (see below)

       file_write(PATH[, OPTIONS])
	   write the given contents to the file at the given path; supported
	   options:

	   ·   "binmode": binary mode to use (see below)

	   ·   "bufsize": buffer size to use for I/O operations

	   ·   "data": provide the file contents via this scalar, scalar
	       reference or code reference (see below)

OPTIONS
       All the functions support a "binmode" option specifying how the file
       should be accessed:

       ·   "binary": binmode(FH) will be used to treat the file as binary

       ·   "utf8": binmode(FH, ":encoding(utf8)") will be used to select UTF-8
	   encoding

       ·   otherwise: binmode() will not be used (this is the default)

       file_read() can be given a code reference via the "data" option.	 Each
       time data is read via sysread(), the subroutine will be called with the
       read data. At the end of the file, the subroutine will be called with
       an empty string.

       file_write() can be given a code reference via the "data" option. It
       should return data in a way similar to sysread(), returning an empty
       string to indicate the end of the data to write to the file.

GLOBAL VARIABLES
       This module uses the following global variables (none of them being
       exported):

       $DefaultBufSize
	   default buffer size to use for I/O operations if not specified via
	   the "bufsize" option (default: 1MB)

SEE ALSO
       No::Worries.

AUTHOR
       Lionel Cons <http://cern.ch/lionel.cons>

       Copyright CERN 2012

perl v5.14.3			  2012-12-19		  No::Worries::File(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net