Revision history File::Slurp 9999.19 Tue Jun 7 04:06:06 EDT 2011 - Fixed use line in t/edit_file.t to import :edit first Thanks to paul - read_file and write_file work even when interrupted by signals this includes a test for read_file interrupt Thanks to Andrew Danforth - Fixed bugs in the config synopsis example 9999.18 Fri May 13 02:30:05 EDT 2011 - Added :std and :edit export tags - Cleaned up EXPORT vars - Documented importing edit_file and edit_file_lines - Fixed some pod spelling 9999.17 Wed Apr 27 02:20:03 EDT 2011 - Requiring Perl 5.6.2 (first time older Perls were dropped) This is because of use of the re 'taint' pragma - Added major new features: edit_file and edit_file_lines - Speed up of tainted slurp with return of lines - Added chomp option to read_file - Added prefix option to read_dir - Fixed optimization of reading small files. 9999.16 Wed Apr 13 03:47:26 EDT 2011 - Added support for read_file options to be a hash reference. - Added support for read_dir options to be a hash reference. - Added new feature prepend_file - Fixed bug with array_ref in list context. was introduced by .15/.14 Thanks to Norbert Gruener - Cleaned up some pod 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 legend, better CLI options, size is selectable, benchmark 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. - t/error.t uses a new test driver module. this may get used by 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, a key the benchmarks, help and more benchmarks. - Reordered changes so recent entries are first - Added error check on atomic rename and test for it Thanks to Daniel Scott Sterling 9999.12 Thu Feb 2 02:26:31 EST 2006 - Fixed bug on windows with classic slurping and File::Slurp not agreeing on newline conversion. - Added t/newline.t test to check for that fix. - When passing text data by scalar reference to write_file under windows, the buffer is copied so the newline conversion won't modify the caller's data. - Thanks to Johan Lodin for a test script which I modified into t/newline.t 9999.11 Fri Jan 20 01:24:00 EDT 2005 - Quick release to remove code that forced the faked SEEK_* values to be used. Showed up when tested on OSX which doesn't need that backport. 9999.10 Thu Jan 19 11:38:00 EDT 2005 - t/*.t modules don't use Fcntl.pm - using POSIX qw( :fcntl_h ) instead of Fcntl qw( :seek ) for backwards compatiblity to 5.00503 - added conditional definitions of SEEK_* and O_* subs as they are not defined in perl 5.004 - File::Slurp now runs on perl 5.004 and newer (see BUGS section) All of the above thanks to Smylers , Piers Kent and John Alden - Added pod.t and pod_coverage.t tests. This is to pass all the CPANTS tests. 9999.09 Tue Apr 19 01:21:55 EDT 2005 - t/original.t and read_dir.t no longer search for tempdirs. they just use the current dir which should be in the build directory - t/readdir.t renamed to read_dir.t for consistancy - write_file return values are docuemented Thanks to Adam Kennedy - added no_clobber option to write_file and t/no_clobber.t test for it Thanks to - fixed bug when appending a null string to a file which then truncates it. seems to be an odd way for linux and OS X to handle O_APPEND mode on sysopen. they don't seek to the end of the file so it gets truncated. fixed by adding a seek to the end if in append mode.n Thanks to Chris Dolan 9999.08 Sat Apr 16 01:01:27 EDT 2005 - read_dir returns an array ref in scalar context - read_dir keeps . and .. if keep_dot_dot option is set. Thanks to John Alden - slurp() is an optional exported alias to read_file Thanks to Damian Conway 9999.07 Tue Jan 25 01:33:11 EST 2005 - Slurping in pseudo files (as in /proc) which show a size of 0 but actually have data works. This seems to be the case on linux but on Solaris those files show their proper size. Thanks to Juerd Waalboer 9999.06 Mon Sep 20 01:57:00 EDT 2004 - Slurping the DATA handle now works without the workaround. tests are in t/data_scalar.t and t/data_list.t - Paragraph mode in read_file is supported. As with <> when $/ (input record separator) is set to '', then the input file is split on multiple newlines (/\n\n+/). Thanks to Geoffrey Leach 9999.05 Tue Feb 24 21:14:55 EST 2004 - skip handle tests where socketpair is not supported (pre 5.8 on windows) Thanks to Mike Arms 9999.04 Mon Feb 23 14:20:52 EST 2004 - fixed DATA handle bug in t/handle.t (not seen on most OS's) Thanks to James Willmore 9999.03 Mon Dec 22 01:44:43 EST 2003 - fixed DATA handle bugs in t/handle.t on osx (should be fixed on BSD as well) - added more comments to code 9999.02 Wed Dec 17 03:40:49 EST 2003 - skip DATA test in handle.t on OSX (bug in perl with sysread on DATA) - changed checking if file handle from fileno to ref from Randal Schwartz - added support for atomic spewing - added new test stdin.t for the fileno/ref change - added new test inode.t to test atomic spewing 9999.01 Mon Sep 1 00:20:56 2003 - original version; created by h2xs 1.21 with options -AX -n File::FastSlurp