Revision history File::Slurp
-9999.14 Wed Apr 21 02:47:45 EDT 2010
+9999.16 Wed Apr 13 03:47:26 EDT 2011
+ - Added support for read_file options to be a hash reference.
+ - Added new feature prepend_file
+
+9999.15 Thu Mar 24 16:40:19 EDT 2011
+ - Fixed error.t test so it works when run as root
+ - Removed skip lines from error.t
+ - Fixed pod about binmode option to reflect changes in .14
+
+9999.14 Sun Mar 20 16:26:47 EDT 2011
+ - Added LICENCE (same as perl) to POD
- Added special faster code to slurp in small text files which
is a common case
- Rewrote the extras/slurp_bench.pl script. It has a full
entries have more consistant names and it compares the new
fast slurp for small files to the general slurp code.
Thanks to Mark Friendlich
+ - Cleaned up pod
+ - Added more Synopsis examples
- Added t/error.t to actually test error conditions. Previous
error.t was renamed to error_mode.t which better reflects its
tests.
other tests in the future.
- Fixed check for SEEK_SET and other constant subs being defined
- Added support for binmode other than :raw and binmode.t test
+ Thanks to Martin J. Evans, Peter Edwards, Bryce Nesbitt
+ - Added support for perms option in write_file and perms.t test
+ Thanks to Peter Corlett and Paul Miller
+ - Added check to the rename call in atomic mode. Tested in error.t.
+ Thanks to Daniel Scott Sterling
+ - Added POD to state that using scalar_ref or buf_ref will be faster
+ and save memory due to not making a copy
+ Thanks to Peter Edwards
+ - read_file in list mode keeps data tainted
+ Thanks to Sébastien Aperghis-Tramoni
+ - read_file checks for an overloaded object to get the file
+ name.
+ Thanks to Sébastien Aperghis-Tramoni
9999.13 Tue Oct 10 02:04:51 EDT 2006
- Refactored the extras/slurp_bench.pl script. It has options,
Makefile.PL
MANIFEST
README
+TODO
+t/TestDriver.pm
+t/append_null.t
+t/binmode.t
+t/data_list.t
+t/data_scalar.t
t/error.t
-t/large.t
+t/error_mode.t
+t/file_object.t
t/handle.t
-t/data_scalar.t
-t/data_list.t
-t/paragraph.t
-t/original.t
-t/stdin.t
t/inode.t
-t/pseudo.t
-t/read_dir.t
-t/slurp.t
-t/no_clobber.t
-t/append_null.t
+t/large.t
t/newline.t
+t/no_clobber.t
+t/original.t
+t/paragraph.t
+t/perms.t
t/pod.t
t/pod_coverage.t
+t/pseudo.t
+t/read_dir.t
+t/slurp.t
+t/stdin.t
+t/stringify.t
+t/tainted.t
+t/write_file_win32.t
+experiment/prepend.pl
+experiment/edit_file.pl
extras/slurp_bench.pl
+extras/FileSlurp_12.pm
extras/slurp_article.pod
META.yml Module meta-data (added by MakeMaker)
+use strict ;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
- 'NAME' => 'File::Slurp',
- 'VERSION_FROM' => 'lib/File/Slurp.pm', # finds $VERSION
- 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
- ($] >= 5.005 ? ## Add these new keywords supported since 5.005
- (ABSTRACT_FROM => 'lib/File/Slurp.pm', # retrieve abstract from module
- AUTHOR => 'Uri Guttman <uri@stemsystems.com>') : ()),
+ 'NAME' => 'File::Slurp',
+ 'LICENSE' => 'perl',
+ 'AUTHOR' => 'Uri Guttman <uri@stemsystems.com>',
+ 'VERSION_FROM' => 'lib/File/Slurp.pm',
+ 'ABSTRACT_FROM' => 'lib/File/Slurp.pm',
+ 'META_MERGE' => {
+ requires => {
+ perl => 5.004,
+ },
+ },
+ 'PREREQ_PM' => {
+ 'Carp' => 0,
+ 'Exporter' => 0,
+ 'Fcntl' => 0,
+ 'POSIX' => 0,
+ },
);
-File::Slurp.pm version 0.04
+File::Slurp.pm
===========================
This module provides subroutines to read or write entire files with a
In the extras/ directory you can read an article (slurp_article.pod)
about file slurping and also run a benchmark (slurp_bench.pl) that
-compares many ways of slurping/spewing files.
+compares many ways of slurping/spewing files. This benchmark was
+rewritten for .14 and is much better.
This module was first written and owned by David Muir Sharnoff (MUIR on
CPAN). I checked out his module and decided to write a new version
-which would be faster, and with many more features. To that end, David
+which would be faster and with many more features. To that end, David
graciously transfered the namespace to me.
-Since then, I discovered and fixed a bug in the original module's test
-script (which had only 7 tests), which is included now as t/original.t.
-This module now has 164 tests in 7 test scripts, and passes on Windows,
-Linux, Solaris and Mac OS X.
-
There have been some comments about the somewhat unusual version number.
The problem was that David used a future date (2004.0904) in his version
number, and the only way I could get CPAN to index my new module was to
COPYRIGHT AND LICENCE
-Copyright (C) 2003 Uri Guttman <uri@stemsystems.com>
+Copyright (C) 2010 Uri Guttman <uri@PerlHunter.com>
Licensed the same as Perl.
-optimize read_file for smaller scalar slurps with no options
+File::Slurp TODO
-prepend_file()
+NEW FEATURES
- options: lock file?
+prepend_file() -- prepend text to the front of a file
+
+ options: lock file? enable atomic
-edit_file()
+edit_file() -- slurp into $_, call edit code block, write out $_
options: lock file?
-edit_file_lines()
+edit_file_lines() -- slurp each line into $_, call edit code block,
+ write out $_
options: lock file?
-add options to read_dir
- prepend_dir
- grep filter qr or code ref
+read_file_lines()
+ reads lines to array ref or list
+ same as $list = read_file( $file, { array_ref => 1 }
+ or @lines = read_file()
+new options for read_dir
+ prepend -- prepend the dir name to each dir entry.
+ filter -- grep dir entries with qr// or code ref.
BUGS:
restart sysread/write after a signal (or check i/o count)
-fix SEEK stuff
-
-sent in patches:
-
-check for objects/refs to filenames
-
-add chmod mode to write_file
-
-add perms (same as chmod?) to syswrite
-
-check result of rename in atomic mode
-
-
-
+FEATURE REQUESTS