diff -Nru io-stringy-2.110/debian/changelog io-stringy-2.111/debian/changelog --- io-stringy-2.110/debian/changelog 2011-09-18 04:41:16.000000000 +0000 +++ io-stringy-2.111/debian/changelog 2021-03-21 01:21:03.000000000 +0000 @@ -1,3 +1,24 @@ +io-stringy (2.111-2~16.04.sav0) xenial; urgency=medium + + * Backport to Xenial + + -- Rob Savoury Sat, 20 Mar 2021 18:21:03 -0700 + +io-stringy (2.111-2) unstable; urgency=medium + + * debian/links: Removed. Closes: #833598. + + -- Bart Martens Sun, 07 Aug 2016 07:51:06 +0200 + +io-stringy (2.111-1) unstable; urgency=medium + + * New upstream release. + * debian/patches/01_close.diff: Removed obsolete patch. + * debian/patches/02_over.diff: Added "=back". + * debian/install, debian/doc-base: Removed. + + -- Bart Martens Fri, 05 Aug 2016 10:35:20 +0200 + io-stringy (2.110-5) unstable; urgency=low * Switch to dpkg-source 3.0 (quilt) format. diff -Nru io-stringy-2.110/debian/control io-stringy-2.111/debian/control --- io-stringy-2.110/debian/control 2011-09-18 04:12:47.000000000 +0000 +++ io-stringy-2.111/debian/control 2016-08-05 08:35:20.000000000 +0000 @@ -2,7 +2,7 @@ Section: perl Priority: optional Maintainer: Bart Martens -Standards-Version: 3.9.2 +Standards-Version: 3.9.8 Build-Depends: debhelper (>= 8.0.0) Build-Depends-Indep: perl (>> 5.8.1) Homepage: http://search.cpan.org/dist/IO-stringy/ diff -Nru io-stringy-2.110/debian/doc-base io-stringy-2.111/debian/doc-base --- io-stringy-2.110/debian/doc-base 2011-09-18 04:06:44.000000000 +0000 +++ io-stringy-2.111/debian/doc-base 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -Document: libio-stringy-perl -Title: Perl5 modules for manipulating scalar as files (IO-Stringy) -Author: -Abstract: IO-Stringy is a collection of Perl5 IO:: modules - for manipulating data in scalar or array data structures using - file mechanisms. Allows for memory basesd temporary file among - other things. -Section: Programming - -Format: HTML -Index: /usr/share/doc/libio-stringy-perl/html/index.html -Files: /usr/share/doc/libio-stringy-perl/html/*.html diff -Nru io-stringy-2.110/debian/install io-stringy-2.111/debian/install --- io-stringy-2.110/debian/install 2011-09-18 04:06:44.000000000 +0000 +++ io-stringy-2.111/debian/install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -docs/IO/* usr/share/doc/libio-stringy-perl/html/ diff -Nru io-stringy-2.110/debian/links io-stringy-2.111/debian/links --- io-stringy-2.110/debian/links 2011-09-18 04:06:44.000000000 +0000 +++ io-stringy-2.111/debian/links 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/share/doc/libio-stringy-perl/html/Stringy.pm.html usr/share/doc/libio-stringy-perl/html/index.html diff -Nru io-stringy-2.110/debian/patches/01_close.diff io-stringy-2.111/debian/patches/01_close.diff --- io-stringy-2.110/debian/patches/01_close.diff 2011-09-18 04:06:44.000000000 +0000 +++ io-stringy-2.111/debian/patches/01_close.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -Check "close" exit code. Closes: #409947. -Patch by Eduardo Pérez Ureta , thanks. - - -diff -ruN -x '*.png' -x '*.jpg' -x '*.ogg' -x '*_image_archive' ../orig/io-stringy-2.110.orig/lib/IO/AtomicFile.pm ./lib/IO/AtomicFile.pm ---- ../orig/io-stringy-2.110.orig/lib/IO/AtomicFile.pm 2005-02-10 22:21:53.000000000 +0100 -+++ ./lib/IO/AtomicFile.pm 2007-11-25 12:12:04.000000000 +0100 -@@ -86,10 +86,13 @@ - sub close { - my ($self, $die) = @_; - unless ($self->_closed(1)) { ### sentinel... -- $self->SUPER::close(); -- rename(${*$self}{'io_atomicfile_temp'}, -- ${*$self}{'io_atomicfile_path'}) -- or ($die ? die "close atomic file: $!\n" : return undef); -+ if ($self->SUPER::close()) { -+ rename(${*$self}{'io_atomicfile_temp'}, -+ ${*$self}{'io_atomicfile_path'}) -+ or ($die ? die "close (rename) atomic file: $!\n" : return undef); -+ } else { -+ $die ? die "close atomic file: $!\n" : return undef; -+ } - } - 1; - } diff -Nru io-stringy-2.110/debian/patches/02_over.diff io-stringy-2.111/debian/patches/02_over.diff --- io-stringy-2.110/debian/patches/02_over.diff 2011-09-18 04:40:44.000000000 +0000 +++ io-stringy-2.111/debian/patches/02_over.diff 2016-08-05 08:35:20.000000000 +0000 @@ -1,6 +1,8 @@ ---- ../orig/io-stringy-2.110/./lib/IO/Wrap.pm 2005-02-10 22:21:53.000000000 +0100 -+++ ./lib/IO/Wrap.pm 2011-09-18 06:37:31.000000000 +0200 -@@ -209,6 +209,8 @@ +Index: io-stringy-2.111/lib/IO/Wrap.pm +=================================================================== +--- io-stringy-2.111.orig/lib/IO/Wrap.pm 2016-08-05 11:33:27.885119463 +0200 ++++ io-stringy-2.111/lib/IO/Wrap.pm 2016-08-05 11:34:44.133097508 +0200 +@@ -215,6 +215,8 @@ =head1 AUTHOR @@ -8,9 +10,19 @@ + =item Primary Maintainer - David F. Skoll (F). ---- ../orig/io-stringy-2.110/./lib/IO/WrapTie.pm 2005-02-10 22:21:53.000000000 +0100 -+++ ./lib/IO/WrapTie.pm 2011-09-18 06:40:29.000000000 +0200 + Dianne Skoll (F). +@@ -224,5 +226,7 @@ + Eryq (F). + President, ZeeGee Software Inc (F). + ++=back ++ + =cut + +Index: io-stringy-2.111/lib/IO/WrapTie.pm +=================================================================== +--- io-stringy-2.111.orig/lib/IO/WrapTie.pm 2016-08-05 11:33:27.885119463 +0200 ++++ io-stringy-2.111/lib/IO/WrapTie.pm 2016-08-05 11:34:56.613093768 +0200 @@ -478,6 +478,8 @@ =head1 AUTHOR @@ -19,4 +31,12 @@ + =item Primary Maintainer - David F. Skoll (F). + Dianne Skoll (F). +@@ -487,5 +489,7 @@ + Eryq (F). + President, ZeeGee Software Inc (F). + ++=back ++ + =cut + diff -Nru io-stringy-2.110/debian/patches/03_item.diff io-stringy-2.111/debian/patches/03_item.diff --- io-stringy-2.110/debian/patches/03_item.diff 1970-01-01 00:00:00.000000000 +0000 +++ io-stringy-2.111/debian/patches/03_item.diff 2016-08-05 08:35:20.000000000 +0000 @@ -0,0 +1,46 @@ +--- ../orig/io-stringy-2.111/./lib/IO/Stringy.pm 2015-04-22 19:26:15.000000000 +0200 ++++ ./lib/IO/Stringy.pm 2016-08-05 11:19:29.009158129 +0200 +@@ -150,35 +150,14 @@ + Closed the following bugs at + https://rt.cpan.org/NoAuth/Bugs.html?Dist=IO-stringy: + +-=item +- +-2208 IO::ScalarArray->getline does not return undef for EOF if undef($/) +- +-=item +- +-7132 IO-stringy/Makefile.PL bug - name should be module name +- +-=item +- +-11249 IO::Scalar flush shouldn't return undef +- +-=item +- +-2172 $\ (output record separator) not respected +- +-=item +- +-8605 IO::InnerFile::seek() should return 1 on success +- +-=item +- +-4798 *.html in lib/ +- +-=item +- +-4369 Improvement: handling of fixed-size reads in IO::Scalar +- +-(Actually, bug 4369 was closed in Version 2.109) ++ 2208 IO::ScalarArray->getline does not return undef for EOF if undef($/) ++ 7132 IO-stringy/Makefile.PL bug - name should be module name ++ 11249 IO::Scalar flush shouldn't return undef ++ 2172 $\ (output record separator) not respected ++ 8605 IO::InnerFile::seek() should return 1 on success ++ 4798 *.html in lib/ ++ 4369 Improvement: handling of fixed-size reads in IO::Scalar ++ (Actually, bug 4369 was closed in Version 2.109) + + =item Version 2.109 (2003/12/21) + diff -Nru io-stringy-2.110/debian/patches/series io-stringy-2.111/debian/patches/series --- io-stringy-2.110/debian/patches/series 2011-09-18 04:38:11.000000000 +0000 +++ io-stringy-2.111/debian/patches/series 2016-08-05 08:35:20.000000000 +0000 @@ -1,2 +1,2 @@ -01_close.diff 02_over.diff +03_item.diff Binary files /tmp/tmpXTeuOS/LlT_l3Ivm_/io-stringy-2.110/docs/icons/h1bullet.gif and /tmp/tmpXTeuOS/TnC2j4pXBA/io-stringy-2.111/docs/icons/h1bullet.gif differ Binary files /tmp/tmpXTeuOS/LlT_l3Ivm_/io-stringy-2.110/docs/icons/h2bullet.gif and /tmp/tmpXTeuOS/TnC2j4pXBA/io-stringy-2.111/docs/icons/h2bullet.gif differ Binary files /tmp/tmpXTeuOS/LlT_l3Ivm_/io-stringy-2.110/docs/icons/itembullet.gif and /tmp/tmpXTeuOS/TnC2j4pXBA/io-stringy-2.111/docs/icons/itembullet.gif differ Binary files /tmp/tmpXTeuOS/LlT_l3Ivm_/io-stringy-2.110/docs/icons/zeegee.gif and /tmp/tmpXTeuOS/TnC2j4pXBA/io-stringy-2.111/docs/icons/zeegee.gif differ diff -Nru io-stringy-2.110/docs/index.html io-stringy-2.111/docs/index.html --- io-stringy-2.110/docs/index.html 2000-04-19 00:04:43.000000000 +0000 +++ io-stringy-2.111/docs/index.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ - -perlmod - - - - - - - - <BODY> - Go <A HREF="menu.html">here</A> - </BODY> - diff -Nru io-stringy-2.110/docs/index.menu io-stringy-2.111/docs/index.menu --- io-stringy-2.110/docs/index.menu 2001-09-21 19:51:44.000000000 +0000 +++ io-stringy-2.111/docs/index.menu 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -MENU perlmod - -SECTION Overview - -ITEM IO::Stringy -HREF IO/Stringy.pm.html - -SECTION Modules - -ITEM IO::AtomicFile -HREF IO/AtomicFile.pm.html - -ITEM IO::InnerFile -HREF IO/InnerFile.pm.html - -ITEM IO::Lines -HREF IO/Lines.pm.html - -ITEM IO::Scalar -HREF IO/Scalar.pm.html - -ITEM IO::ScalarArray -HREF IO/ScalarArray.pm.html - -ITEM IO::Wrap -HREF IO/Wrap.pm.html - -ITEM IO::WrapTie -HREF IO/WrapTie.pm.html - -SECTION Examples - -ITEM IO_Scalar_synopsis -HREF IO_Scalar_synopsis.html - diff -Nru io-stringy-2.110/docs/index-menu.html io-stringy-2.111/docs/index-menu.html --- io-stringy-2.110/docs/index-menu.html 2001-09-21 19:51:44.000000000 +0000 +++ io-stringy-2.111/docs/index-menu.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ - - -perlmod - - - - - - -
Overview
IO::Stringy
-
- - - - - - - - - - - - - - - - -
Modules
IO::AtomicFile
IO::InnerFile
IO::Lines
IO::Scalar
IO::ScalarArray
IO::Wrap
IO::WrapTie
-
- - - - -
Examples
IO_Scalar_synopsis
-
-
- diff -Nru io-stringy-2.110/docs/IO/AtomicFile.pm.html io-stringy-2.111/docs/IO/AtomicFile.pm.html --- io-stringy-2.110/docs/IO/AtomicFile.pm.html 2003-12-21 18:54:37.000000000 +0000 +++ io-stringy-2.111/docs/IO/AtomicFile.pm.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ - - - IO::AtomicFile 2.101 - - -ZeeGee Software

IO::AtomicFile 2.101

-
- - -


-

Top NAME

- - -

IO::AtomicFile - write a file which is updated atomically - - - -


-

Top SYNOPSIS

- -
-    use IO::AtomicFile;
-
-
-    ### Write a temp file, and have it install itself when closed:
-    my $FH = IO::AtomicFile->open("bar.dat", "w");
-    print $FH "Hello!\n";
-    $FH->close || die "couldn't install atomic file: $!";    
-
-
-    ### Write a temp file, but delete it before it gets installed:
-    my $FH = IO::AtomicFile->open("bar.dat", "w");
-    print $FH "Hello!\n";
-    $FH->delete; 
-
-
-    ### Write a temp file, but neither install it nor delete it:
-    my $FH = IO::AtomicFile->open("bar.dat", "w");
-    print $FH "Hello!\n";
-    $FH->detach;   
-
- - -


-

Top DESCRIPTION

- - -

This module is intended for people who need to update files -reliably in the face of unexpected program termination. - - -

For example, you generally don't want to be halfway in the middle of -writing /etc/passwd and have your program terminate! Even -the act of writing a single scalar to a filehandle is not atomic. - - -

But this module gives you true atomic updates, via rename(). -When you open a file /foo/bar.dat via this module, you are actually -opening a temporary file /foo/bar.dat..TMP, and writing your -output there. The act of closing this file (either explicitly -via close(), or implicitly via the destruction of the object) -will cause rename() to be called... therefore, from the point -of view of the outside world, the file's contents are updated -in a single time quantum. - - -

To ensure that problems do not go undetected, the "close" method -done by the destructor will raise a fatal exception if the rename() -fails. The explicit close() just returns undef. - - -

You can also decide at any point to trash the file you've been -building. - - - -


-

Top AUTHOR

- - -

Eryq (eryq@zeegee.com). -President, ZeeGee Software Inc (http://www.zeegee.com). - - - -


-

Top REVISION

- - -

$Revision: 2.101 $ - -


-
-Generated Sun Dec 21 13:54:37 2003 by cvu_pod2html -
-
- Binary files /tmp/tmpXTeuOS/LlT_l3Ivm_/io-stringy-2.110/docs/IO/icons/h1bullet.gif and /tmp/tmpXTeuOS/TnC2j4pXBA/io-stringy-2.111/docs/IO/icons/h1bullet.gif differ Binary files /tmp/tmpXTeuOS/LlT_l3Ivm_/io-stringy-2.110/docs/IO/icons/h2bullet.gif and /tmp/tmpXTeuOS/TnC2j4pXBA/io-stringy-2.111/docs/IO/icons/h2bullet.gif differ Binary files /tmp/tmpXTeuOS/LlT_l3Ivm_/io-stringy-2.110/docs/IO/icons/itembullet.gif and /tmp/tmpXTeuOS/TnC2j4pXBA/io-stringy-2.111/docs/IO/icons/itembullet.gif differ Binary files /tmp/tmpXTeuOS/LlT_l3Ivm_/io-stringy-2.110/docs/IO/icons/zeegee.gif and /tmp/tmpXTeuOS/TnC2j4pXBA/io-stringy-2.111/docs/IO/icons/zeegee.gif differ diff -Nru io-stringy-2.110/docs/IO/InnerFile.pm.html io-stringy-2.111/docs/IO/InnerFile.pm.html --- io-stringy-2.110/docs/IO/InnerFile.pm.html 2003-12-21 18:54:37.000000000 +0000 +++ io-stringy-2.111/docs/IO/InnerFile.pm.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ - - - IO::InnerFile 2.102 - - -ZeeGee Software

IO::InnerFile 2.102

-
- - -


-

Top NAME

- - -

IO::InnerFile - define a file inside another file - - - -


-

Top SYNOPSIS

- -
-    ### Read a subset of a file:
-    $inner = IO::InnerFile->new($fh, $start, $length);
-    while (<$inner>) {
-	...
-    }
-
- - -


-

Top DESCRIPTION

- - -

If you have a filehandle that can seek() and tell(), then you -can open an IO::InnerFile on a range of the underlying file. - - - -


-

Top PUBLIC INTERFACE

- - - -
-

Top new FILEHANDLE, [START, [LENGTH]]
-
-Class method, constructor. -Create a new inner-file opened on the given FILEHANDLE, -from bytes START to START+LENGTH. Both START and LENGTH -default to 0; negative values are silently coerced to zero. - - -

Note that FILEHANDLE must be able to seek() and tell(), in addition -to whatever other methods you may desire for reading it. - -

Top set_length LENGTH
-
-

Top get_length
-
-

Top add_length NBYTES
-
-Instance methods. -Get/set the virtual length of the inner file. - -

Top set_start START
-
-

Top get_start
-
-

Top add_start NBYTES
-
-Instance methods. -Get/set the virtual start position of the inner file. - -

Top binmode
-
-

Top close
-
-

Top flush
-
-

Top getc
-
-

Top getline
-
-

Top print LIST
-
-

Top printf LIST
-
-

Top read BUF, NBYTES
-
-

Top readline
-
-

Top seek OFFFSET, WHENCE
-
-

Top tell
-
-

Top write ARGS...
-
-Instance methods. -Standard filehandle methods. - -
- - - -


-

Top VERSION

- - -

$Id: InnerFile.pm,v 2.102 2001/08/17 02:06:33 eryq Exp $ - - - -


-

Top AUTHOR

- - -

Original version by Doru Petrescu (pdoru@kappa.ro). - - -

Documentation and current maintenance by Eryq (eryq@zeegee.com). - -


-
-Generated Sun Dec 21 13:54:37 2003 by cvu_pod2html -
-
- diff -Nru io-stringy-2.110/docs/IO/Lines.pm.html io-stringy-2.111/docs/IO/Lines.pm.html --- io-stringy-2.110/docs/IO/Lines.pm.html 2003-12-21 18:54:37.000000000 +0000 +++ io-stringy-2.111/docs/IO/Lines.pm.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ - - - IO::Lines 2.103 - - -ZeeGee Software

IO::Lines 2.103

-
- - -


-

Top NAME

- - -

IO::Lines - IO:: interface for reading/writing an array of lines - - - -


-

Top SYNOPSIS

- -
-    use IO::Lines;
-
-
-    ### See IO::ScalarArray for details 
-
- - -


-

Top DESCRIPTION

- - -

This class implements objects which behave just like FileHandle -(or IO::Handle) objects, except that you may use them to write to -(or read from) an array of lines. They can be tiehandle'd as well. - - -

This is a subclass of IO::ScalarArray -in which the underlying -array has its data stored in a line-oriented-format: that is, -every element ends in a "\n", with the possible exception of the -final element. This makes getline() much more efficient; -if you plan to do line-oriented reading/printing, you want this class. - - -

The print() method will enforce this rule, so you can print -arbitrary data to the line-array: it will break the data at -newlines appropriately. - - -

See IO::ScalarArray for full usage and warnings. - - - -


-

Top VERSION

- - -

$Id: Lines.pm,v 2.103 2001/08/09 08:04:44 eryq Exp $ - - - -


-

Top AUTHORS

- - - -


-

Top Principal author

- - -

Eryq (eryq@zeegee.com). -President, ZeeGee Software Inc (http://www.zeegee.com). - - - -


-

Top Other contributors

- - -

Thanks to the following individuals for their invaluable contributions -(if I've forgotten or misspelled your name, please email me!): - - -

Morris M. Siegel, -for his $/ patch and the new getlines(). - - -

Doug Wilson, -for the IO::Handle inheritance and automatic tie-ing. - -


-
-Generated Sun Dec 21 13:54:37 2003 by cvu_pod2html -
-
- diff -Nru io-stringy-2.110/docs/IO/ScalarArray.pm.html io-stringy-2.111/docs/IO/ScalarArray.pm.html --- io-stringy-2.110/docs/IO/ScalarArray.pm.html 2003-12-21 18:54:37.000000000 +0000 +++ io-stringy-2.111/docs/IO/ScalarArray.pm.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,454 +0,0 @@ - - - IO::ScalarArray 2.103 - - -ZeeGee Software

IO::ScalarArray 2.103

-
- - -


-

Top NAME

- - -

IO::ScalarArray - IO:: interface for reading/writing an array of scalars - - - -


-

Top SYNOPSIS

- - -

Perform I/O on strings, using the basic OO interface... - -

-    use IO::ScalarArray;
-    @data = ("My mes", "sage:\n");
-
-
-    ### Open a handle on an array, and append to it:
-    $AH = new IO::ScalarArray \@data;
-    $AH->print("Hello");       
-    $AH->print(", world!\nBye now!\n");  
-    print "The array is now: ", @data, "\n";
-
-
-    ### Open a handle on an array, read it line-by-line, then close it:
-    $AH = new IO::ScalarArray \@data;
-    while (defined($_ = $AH->getline)) { 
-	print "Got line: $_";
-    }
-    $AH->close;
-
-
-    ### Open a handle on an array, and slurp in all the lines:
-    $AH = new IO::ScalarArray \@data;
-    print "All lines:\n", $AH->getlines; 
-
-
-    ### Get the current position (either of two ways):
-    $pos = $AH->getpos;         
-    $offset = $AH->tell;  
-
-
-    ### Set the current position (either of two ways):
-    $AH->setpos($pos);        
-    $AH->seek($offset, 0);
-
-
-    ### Open an anonymous temporary array:
-    $AH = new IO::ScalarArray;
-    $AH->print("Hi there!");
-    print "I printed: ", @{$AH->aref}, "\n";      ### get at value
-
- -

Don't like OO for your I/O? No problem. -Thanks to the magic of an invisible tie(), the following now -works out of the box, just as it does with IO::Handle: - - use IO::ScalarArray; - @data = ("My mes", "sage:\n"); - -

-    ### Open a handle on an array, and append to it:
-    $AH = new IO::ScalarArray \@data;
-    print $AH "Hello";    
-    print $AH ", world!\nBye now!\n";
-    print "The array is now: ", @data, "\n";
-
-
-    ### Open a handle on a string, read it line-by-line, then close it:
-    $AH = new IO::ScalarArray \@data;
-    while (<$AH>) {
-	print "Got line: $_";
-    }
-    close $AH;
-
-
-    ### Open a handle on a string, and slurp in all the lines:
-    $AH = new IO::ScalarArray \@data;
-    print "All lines:\n", <$AH>;
-
-
-    ### Get the current position (WARNING: requires 5.6):
-    $offset = tell $AH;
-
-
-    ### Set the current position (WARNING: requires 5.6):
-    seek $AH, $offset, 0;
-
-
-    ### Open an anonymous temporary scalar:
-    $AH = new IO::ScalarArray;
-    print $AH "Hi there!";
-    print "I printed: ", @{$AH->aref}, "\n";      ### get at value
-
- -

And for you folks with 1.x code out there: the old tie() style still works, -though this is unnecessary and deprecated: - -

-    use IO::ScalarArray;
-
-
-    ### Writing to a scalar...
-    my @a; 
-    tie *OUT, 'IO::ScalarArray', \@a;
-    print OUT "line 1\nline 2\n", "line 3\n";
-    print "Array is now: ", @a, "\n"
-
-
-    ### Reading and writing an anonymous scalar... 
-    tie *OUT, 'IO::ScalarArray';
-    print OUT "line 1\nline 2\n", "line 3\n";
-    tied(OUT)->seek(0,0);
-    while (<OUT>) { 
-        print "Got line: ", $_;
-    }
-
- - -


-

Top DESCRIPTION

- - -

This class is part of the IO::Stringy distribution; -see IO::Stringy for change log and general information. - - -

The IO::ScalarArray class implements objects which behave just like -IO::Handle (or FileHandle) objects, except that you may use them -to write to (or read from) arrays of scalars. Logically, an -array of scalars defines an in-core "file" whose contents are -the concatenation of the scalars in the array. The handles created by -this class are automatically tiehandle'd (though please see WARNINGS -for information relevant to your Perl version). - - -

For writing large amounts of data with individual print() statements, -this class is likely to be more efficient than IO::Scalar. - - -

Basically, this: - -

-    my @a;
-    $AH = new IO::ScalarArray \@a;
-    $AH->print("Hel", "lo, ");         ### OO style
-    $AH->print("world!\n");            ### ditto
-
- -

Or this: - -

-    my @a;
-    $AH = new IO::ScalarArray \@a;
-    print $AH "Hel", "lo, ";           ### non-OO style
-    print $AH "world!\n";              ### ditto
-
- -

Causes @a to be set to the following array of 3 strings: - -

-    ( "Hel" , 
-      "lo, " , 
-      "world!\n" )
-
- -

See IO::Scalar and compare with this class. - - - -


-

Top PUBLIC INTERFACE

- - - -


-

Top Construction

- - - -
-

Top new [ARGS...]
-
-Class method. -Return a new, unattached array handle. -If any arguments are given, they're sent to open(). - -

Top open [ARRAYREF]
-
-Instance method. -Open the array handle on a new array, pointed to by ARRAYREF. -If no ARRAYREF is given, a "private" array is created to hold -the file data. - - -

Returns the self object on success, undefined on error. - -

Top opened
-
-Instance method. -Is the array handle opened on something? - -

Top close
-
-Instance method. -Disassociate the array handle from its underlying array. -Done automatically on destroy. - -
- - - -


-

Top Input and output

- - - -
-

Top flush
-
-Instance method. -No-op, provided for OO compatibility. - -

Top getc
-
-Instance method. -Return the next character, or undef if none remain. -This does a read(1), which is somewhat costly. - -

Top getline
-
-Instance method. -Return the next line, or undef on end of data. -Can safely be called in an array context. -Currently, lines are delimited by "\n". - -

Top getlines
-
-Instance method. -Get all remaining lines. -It will croak() if accidentally called in a scalar context. - -

Top print ARGS...
-
-Instance method. -Print ARGS to the underlying array. - - -

Currently, this always causes a "seek to the end of the array" -and generates a new array entry. This may change in the future. - -

Top read BUF, NBYTES, [OFFSET];
-
-Instance method. -Read some bytes from the array. -Returns the number of bytes actually read, 0 on end-of-file, undef on error. - -

Top write BUF, NBYTES, [OFFSET];
-
-Instance method. -Write some bytes into the array. - -
- - - -


-

Top Seeking/telling and other attributes

- - - -
-

Top autoflush
-
-Instance method. -No-op, provided for OO compatibility. - -

Top binmode
-
-Instance method. -No-op, provided for OO compatibility. - -

Top clearerr
-
-Instance method. Clear the error and EOF flags. A no-op. - -

Top eof
-
-Instance method. Are we at end of file? - -

Top seek POS,WHENCE
-
-Instance method. -Seek to a given position in the stream. -Only a WHENCE of 0 (SEEK_SET) is supported. - -

Top tell
-
-Instance method. -Return the current position in the stream, as a numeric offset. - -

Top setpos POS
-
-Instance method. -Seek to a given position in the array, using the opaque getpos() value. -Don't expect this to be a number. - -

Top getpos
-
-Instance method. -Return the current position in the array, as an opaque value. -Don't expect this to be a number. - -

Top aref
-
-Instance method. -Return a reference to the underlying array. - -
- - - -


-

Top WARNINGS

- - -

Perl's TIEHANDLE spec was incomplete prior to 5.005_57; -it was missing support for seek(), tell(), and eof(). -Attempting to use these functions with an IO::ScalarArray will not work -prior to 5.005_57. IO::ScalarArray will not have the relevant methods -invoked; and even worse, this kind of bug can lie dormant for a while. -If you turn warnings on (via $^W or perl -w), -and you see something like this... - -

-    attempt to seek on unopened filehandle
-
- -

...then you are probably trying to use one of these functions -on an IO::ScalarArray with an old Perl. The remedy is to simply -use the OO version; e.g.: - -

-    $AH->seek(0,0);    ### GOOD: will work on any 5.005
-    seek($AH,0,0);     ### WARNING: will only work on 5.005_57 and beyond
-
- - -


-

Top VERSION

- - -

$Id: ScalarArray.pm,v 2.103 2001/08/09 08:04:44 eryq Exp $ - - - -


-

Top AUTHOR

- - - -


-

Top Principal author

- - -

Eryq (eryq@zeegee.com). -President, ZeeGee Software Inc (http://www.zeegee.com). - - - -


-

Top Other contributors

- - -

Thanks to the following individuals for their invaluable contributions -(if I've forgotten or misspelled your name, please email me!): - - -

Andy Glew, -for suggesting getc(). - - -

Brandon Browning, -for suggesting opened(). - - -

Eric L. Brine, -for his offset-using read() and write() implementations. - - -

Doug Wilson, -for the IO::Handle inheritance and automatic tie-ing. - -


-
-Generated Sun Dec 21 13:54:37 2003 by cvu_pod2html -
-
- diff -Nru io-stringy-2.110/docs/IO/Scalar.pm.html io-stringy-2.111/docs/IO/Scalar.pm.html --- io-stringy-2.110/docs/IO/Scalar.pm.html 2003-12-21 18:54:37.000000000 +0000 +++ io-stringy-2.111/docs/IO/Scalar.pm.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,501 +0,0 @@ - - - IO::Scalar 2.105 - - -ZeeGee Software

IO::Scalar 2.105

-
- - -


-

Top NAME

- - -

IO::Scalar - IO:: interface for reading/writing a scalar - - - -


-

Top SYNOPSIS

- - -

Perform I/O on strings, using the basic OO interface... - -

-    use 5.005;
-    use IO::Scalar;
-    $data = "My message:\n";
-
-
-    ### Open a handle on a string, and append to it:
-    $SH = new IO::Scalar \$data;
-    $SH->print("Hello");
-    $SH->print(", world!\nBye now!\n");
-    print "The string is now: ", $data, "\n";
-
-
-    ### Open a handle on a string, read it line-by-line, then close it:
-    $SH = new IO::Scalar \$data;
-    while (defined($_ = $SH->getline)) {
-	print "Got line: $_";
-    }
-    $SH->close;
-
-
-    ### Open a handle on a string, and slurp in all the lines:
-    $SH = new IO::Scalar \$data;
-    print "All lines:\n", $SH->getlines;
-
-
-    ### Get the current position (either of two ways):
-    $pos = $SH->getpos;
-    $offset = $SH->tell;
-
-
-    ### Set the current position (either of two ways):
-    $SH->setpos($pos);
-    $SH->seek($offset, 0);
-
-
-    ### Open an anonymous temporary scalar:
-    $SH = new IO::Scalar;
-    $SH->print("Hi there!");
-    print "I printed: ", ${$SH->sref}, "\n";      ### get at value
-
- -

Don't like OO for your I/O? No problem. -Thanks to the magic of an invisible tie(), the following now -works out of the box, just as it does with IO::Handle: - -

-    use 5.005;
-    use IO::Scalar;
-    $data = "My message:\n";
-
-
-    ### Open a handle on a string, and append to it:
-    $SH = new IO::Scalar \$data;
-    print $SH "Hello";
-    print $SH ", world!\nBye now!\n";
-    print "The string is now: ", $data, "\n";
-
-
-    ### Open a handle on a string, read it line-by-line, then close it:
-    $SH = new IO::Scalar \$data;
-    while (<$SH>) {
-	print "Got line: $_";
-    }
-    close $SH;
-
-
-    ### Open a handle on a string, and slurp in all the lines:
-    $SH = new IO::Scalar \$data;
-    print "All lines:\n", <$SH>;
-
-
-    ### Get the current position (WARNING: requires 5.6):
-    $offset = tell $SH;
-
-
-    ### Set the current position (WARNING: requires 5.6):
-    seek $SH, $offset, 0;
-
-
-    ### Open an anonymous temporary scalar:
-    $SH = new IO::Scalar;
-    print $SH "Hi there!";
-    print "I printed: ", ${$SH->sref}, "\n";      ### get at value
-
- -

And for you folks with 1.x code out there: the old tie() style still works, -though this is unnecessary and deprecated: - -

-    use IO::Scalar;
-
-
-    ### Writing to a scalar...
-    my $s;
-    tie *OUT, 'IO::Scalar', \$s;
-    print OUT "line 1\nline 2\n", "line 3\n";
-    print "String is now: $s\n"
-
-
-    ### Reading and writing an anonymous scalar...
-    tie *OUT, 'IO::Scalar';
-    print OUT "line 1\nline 2\n", "line 3\n";
-    tied(OUT)->seek(0,0);
-    while (<OUT>) {
-        print "Got line: ", $_;
-    }
-
- -

Stringification works, too! - -

-    my $SH = new IO::Scalar \$data;
-    print $SH "Hello, ";
-    print $SH "world!";
-    print "I printed: $SH\n";
-
- - -


-

Top DESCRIPTION

- - -

This class is part of the IO::Stringy distribution; -see IO::Stringy for change log and general information. - - -

The IO::Scalar class implements objects which behave just like -IO::Handle (or FileHandle) objects, except that you may use them -to write to (or read from) scalars. These handles are -automatically tiehandle'd (though please see WARNINGS -for information relevant to your Perl version). - - -

Basically, this: - -

-    my $s;
-    $SH = new IO::Scalar \$s;
-    $SH->print("Hel", "lo, ");         ### OO style
-    $SH->print("world!\n");            ### ditto
-
- -

Or this: - -

-    my $s;
-    $SH = tie *OUT, 'IO::Scalar', \$s;
-    print OUT "Hel", "lo, ";           ### non-OO style
-    print OUT "world!\n";              ### ditto
-
- -

Causes $s to be set to: - -

-    "Hello, world!\n"
-
- - -


-

Top PUBLIC INTERFACE

- - - -


-

Top Construction

- - - -
-

Top new [ARGS...]
-
-Class method. -Return a new, unattached scalar handle. -If any arguments are given, they're sent to open(). - -

Top open [SCALARREF]
-
-Instance method. -Open the scalar handle on a new scalar, pointed to by SCALARREF. -If no SCALARREF is given, a "private" scalar is created to hold -the file data. - - -

Returns the self object on success, undefined on error. - -

Top opened
-
-Instance method. -Is the scalar handle opened on something? - -

Top close
-
-Instance method. -Disassociate the scalar handle from its underlying scalar. -Done automatically on destroy. - -
- - - -


-

Top Input and output

- - - -
-

Top flush
-
-Instance method. -No-op, provided for OO compatibility. - -

Top getc
-
-Instance method. -Return the next character, or undef if none remain. - -

Top getline
-
-Instance method. -Return the next line, or undef on end of string. -Can safely be called in an array context. -Currently, lines are delimited by "\n". - -

Top getlines
-
-Instance method. -Get all remaining lines. -It will croak() if accidentally called in a scalar context. - -

Top print ARGS...
-
-Instance method. -Print ARGS to the underlying scalar. - - -

Warning: this continues to always cause a seek to the end -of the string, but if you perform seek()s and tell()s, it is -still safer to explicitly seek-to-end before subsequent print()s. - -

Top read BUF, NBYTES, [OFFSET]
-
-Instance method. -Read some bytes from the scalar. -Returns the number of bytes actually read, 0 on end-of-file, undef on error. - -

Top write BUF, NBYTES, [OFFSET]
-
-Instance method. -Write some bytes to the scalar. - -

Top sysread BUF, LEN, [OFFSET]
-
-Instance method. -Read some bytes from the scalar. -Returns the number of bytes actually read, 0 on end-of-file, undef on error. - -

Top syswrite BUF, NBYTES, [OFFSET]
-
-Instance method. -Write some bytes to the scalar. - -
- - - -


-

Top Seeking/telling and other attributes

- - - -
-

Top autoflush
-
-Instance method. -No-op, provided for OO compatibility. - -

Top binmode
-
-Instance method. -No-op, provided for OO compatibility. - -

Top clearerr
-
-Instance method. Clear the error and EOF flags. A no-op. - -

Top eof
-
-Instance method. Are we at end of file? - -

Top seek OFFSET, WHENCE
-
-Instance method. Seek to a given position in the stream. - -

Top sysseek OFFSET, WHENCE
-
-Instance method. Identical to seek OFFSET, WHENCE, q.v. - -

Top tell
-
-Instance method. -Return the current position in the stream, as a numeric offset. - -

Top setpos POS
-
-Instance method. -Set the current position, using the opaque value returned by getpos(). - -

Top getpos
-
-Instance method. -Return the current position in the string, as an opaque object. - -

Top sref
-
-Instance method. -Return a reference to the underlying scalar. - -
- - - -


-

Top WARNINGS

- - -

Perl's TIEHANDLE spec was incomplete prior to 5.005_57; -it was missing support for seek(), tell(), and eof(). -Attempting to use these functions with an IO::Scalar will not work -prior to 5.005_57. IO::Scalar will not have the relevant methods -invoked; and even worse, this kind of bug can lie dormant for a while. -If you turn warnings on (via $^W or perl -w), -and you see something like this... - -

-    attempt to seek on unopened filehandle
-
- -

...then you are probably trying to use one of these functions -on an IO::Scalar with an old Perl. The remedy is to simply -use the OO version; e.g.: - -

-    $SH->seek(0,0);    ### GOOD: will work on any 5.005
-    seek($SH,0,0);     ### WARNING: will only work on 5.005_57 and beyond
-
- - -


-

Top VERSION

- - -

$Id: Scalar.pm,v 2.105 2003/12/21 18:51:45 eryq Exp $ - - - -


-

Top AUTHORS

- - - -


-

Top Principal author

- - -

Eryq (eryq@zeegee.com). -President, ZeeGee Software Inc (http://www.zeegee.com). - - - -


-

Top Other contributors

- - -

The full set of contributors always includes the folks mentioned -in CHANGE LOG. But just the same, special -thanks to the following individuals for their invaluable contributions -(if I've forgotten or misspelled your name, please email me!): - - -

Andy Glew, -for contributing getc(). - - -

Brandon Browning, -for suggesting opened(). - - -

David Richter, -for finding and fixing the bug in PRINTF(). - - -

Eric L. Brine, -for his offset-using read() and write() implementations. - - -

Richard Jones, -for his patches to massively improve the performance of getline() -and add sysread and syswrite. - - -

B. K. Oxley (binkley), -for stringification and inheritance improvements, -and sundry good ideas. - - -

Doug Wilson, -for the IO::Handle inheritance and automatic tie-ing. - - - -


-

Top SEE ALSO

- - -

IO::String, which is quite similar but which was designed -more-recently and with an IO::Handle-like interface in mind, -so you could mix OO- and native-filehandle usage without using tied(). - - -

Note: as of version 2.x, these classes all work like -their IO::Handle counterparts, so we have comparable -functionality to IO::String. - -


-
-Generated Sun Dec 21 13:54:37 2003 by cvu_pod2html -
-
- diff -Nru io-stringy-2.110/docs/IO/Stringy.pm.html io-stringy-2.111/docs/IO/Stringy.pm.html --- io-stringy-2.110/docs/IO/Stringy.pm.html 2003-12-21 18:54:37.000000000 +0000 +++ io-stringy-2.111/docs/IO/Stringy.pm.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,504 +0,0 @@ - - - IO-stringy 2.109 - - -ZeeGee Software

IO-stringy 2.109

-
- - -


-

Top NAME

- - -

IO-stringy - I/O on in-core objects like strings and arrays - - - -


-

Top SYNOPSIS

- -
-    IO::
-    ::AtomicFile   adpO  Write a file which is updated atomically     ERYQ
-    ::Lines        bdpO  I/O handle to read/write to array of lines   ERYQ
-    ::Scalar       RdpO  I/O handle to read/write to a string         ERYQ
-    ::ScalarArray  RdpO  I/O handle to read/write to array of scalars ERYQ
-    ::Wrap         RdpO  Wrap old-style FHs in standard OO interface  ERYQ
-    ::WrapTie      adpO  Tie your handles & retain full OO interface  ERYQ
-
- - -


-

Top DESCRIPTION

- - -

This toolkit primarily provides modules for performing both traditional -and object-oriented i/o) on things other than normal filehandles; -in particular, IO::Scalar, IO::ScalarArray, -and IO::Lines. - - -

In the more-traditional IO::Handle front, we -have IO::AtomicFile -which may be used to painlessly create files which are updated -atomically. - - -

And in the "this-may-prove-useful" corner, we have IO::Wrap, -whose exported wraphandle() function will clothe anything that's not -a blessed object in an IO::Handle-like wrapper... so you can just -use OO syntax and stop worrying about whether your function's caller -handed you a string, a globref, or a FileHandle. - - - -


-

Top WARNINGS

- - -

Perl's TIEHANDLE spec was incomplete prior to 5.005_57; -it was missing support for seek(), tell(), and eof(). -Attempting to use these functions with an IO::Scalar, IO::ScalarArray, -IO::Lines, etc. will not work prior to 5.005_57. -None of the relevant methods will be invoked by Perl; -and even worse, this kind of bug can lie dormant for a while. -If you turn warnings on (via $^W or perl -w), and you see -something like this... - -

-    seek() on unopened file
-
- -

...then you are probably trying to use one of these functions -on one of our IO:: classes with an old Perl. The remedy is to simply -use the OO version; e.g.: - -

-    $SH->seek(0,0);    ### GOOD: will work on any 5.005
-    seek($SH,0,0);     ### WARNING: will only work on 5.005_57 and beyond
-
- - -


-

Top INSTALLATION

- - - -


-

Top Requirements

- - -

As of version 2.x, this toolkit requires Perl 5.005 for -the IO::Handle subclasses, and 5.005_57 or better is -strongly recommended. See WARNINGS for details. - - - -


-

Top Directions

- - -

Most of you already know the drill... - -

-    perl Makefile.PL
-    make
-    make test
-    make install
-
- -

For everyone else out there... -if you've never installed Perl code before, or you're trying to use -this in an environment where your sysadmin or ISP won't let you do -interesting things, relax: since this module contains no binary -extensions, you can cheat. That means copying the directory tree -under my "./lib" directory into someplace where your script can "see" -it. For example, under Linux: - -

-    cp -r IO-stringy-1.234/lib/* /path/to/my/perl/
-
- -

Now, in your Perl code, do this: - -

-    use lib "/path/to/my/perl";
-    use IO::Scalar;                   ### or whatever
-
- -

Ok, now you've been told. At this point, anyone who whines about -not being given enough information gets an unflattering haiku -written about them in the next change log. I'll do it. -Don't think I won't. - - - -


-

Top VERSION

- - -

$Id: Stringy.pm,v 2.109 2003/12/21 18:51:45 eryq Exp $ - - - -


-

Top TO DO

- - - -
-

(2000/08/02) Finalize $/ support
-
-Graham Barr submitted this patch half a year ago; -Like a moron, I lost his message under a ton of others, -and only now have the experimental implementation done. - - -

Will the sudden sensitivity to $/ hose anyone out there? -I'm worried, so you have to enable it explicitly in 1.x. -It will be on by default in 2.x, though only IO::Scalar -has been implemented. - -

(2000/09/28) Separate read/write cursors?
-
-Binkley sent me a very interesting variant of IO::Scalar which -maintains two separate cursors on the data, one for reading -and one for writing. Quoth he: - -
-    Isn't it the case that real operating system file descriptors 
-    maintain an independent read and write file position (and 
-    seek(2) resets them both)? 
-
- -

(My answer: perhaps, but stdio's fseek/ftell manpages seem to -imply a single file position indicator, and I'm trying to be IO::-ish.) -Binkley also pointed out some issues with his implementation: - -

-    For example, what does eof or tell return?  The read position or 
-    the write position?  (I assumed read position was more important). 
-
- -

Your opinions on this are most welcome. -(Me, I'm just squeamish that this will break some code -which depends on the existing behavior, and that attempts to -maintain backwards-compatibility will slow down the code.) - -

(2001/08/08) Remove IO::WrapTie from new IO:: classes
-
-It's not needed. Backwards compatibility could be maintained -by having new_tie() be identical to new(). Heck, I'll bet -that IO::WrapTie should be reimplemented so the returned -object is just like an IO::Scalar in its use of globrefs. - - -
- - - -


-

Top CHANGE LOG

- - - -
-

Top Version 2.109 (2003/12/21)
-
-IO::Scalar::getline now works with ref to int. -Thanks to Dominique Quatravaux for this patch. - -

Top Version 2.108 (2001/08/20)
-
-The terms-of-use have been placed in the distribution file "COPYING". -Also, small documentation tweaks were made. - -

Top Version 2.105 (2001/08/09)
-
-Added support for various seek() whences to IO::ScalarArray. - - -

Added support for consulting $/ in IO::Scalar and IO::ScalarArray. -The old use_RS() is not even an option. -Unsupported record separators will cause a croak(). - - -

Added a lot of regression tests to supoprt the above. - - -

Better on-line docs (hyperlinks to individual functions). - -

Top Version 2.103 (2001/08/08)
-
-After sober consideration I have reimplemented IO::Scalar::print() -so that it once again always seeks to the end of the string. -Benchmarks show the new implementation to be just as fast as -Juergen's contributed patch; until someone can convince me otherwise, -the current, safer implementation stays. - - -

I thought more about giving IO::Scalar two separate handles, -one for reading and one for writing, as suggested by Binkley. -His points about what tell() and eof() return are, I think, -show-stoppers for this feature. Even the manpages for stdio's fseek() -seem to imply a single file position indicator, not two. -So I think I will take this off the TO DO list. -Remedy: you can always have two handles open on the same -scalar, one which you only write to, and one which you only read from. -That should give the same effect. - -

Top Version 2.101 (2001/08/07)
-
-Alpha release. -This is the initial release of the "IO::Scalar and friends are -now subclasses of IO::Handle". I'm flinging it against the wall. -Please tell me if the banana sticks. When it does, the banana -will be called 2.2x. - - -

First off, many many thanks to Doug Wilson, who -has provided an invaluable service by patching IO::Scalar -and friends so that they (1) inherit from IO::Handle, (2) automatically -tie themselves so that the new() objects can be used in native i/o -constructs, and (3) doing it so that the whole damn thing passes -its regression tests. As Doug knows, my globref Kung-Fu was not -up to the task; he graciously provided the patches. This has earned -him a seat at the Co-Authors table, and the -right to have me address him as sensei. - - -

Performance of IO::Scalar::print() has been improved by as much as 2x -for lots of little prints, with the cost of forcing those -who print-then-seek-then-print to explicitly seek to end-of-string -before printing again. -Thanks to Juergen Zeller for this patch. - - -

Added the COPYING file, which had been missing from prior versions. -Thanks to Albert Chin-A-Young for pointing this out. - - -

IO::Scalar consults $/ by default (1.x ignored it by default). -Yes, I still need to support IO::ScalarArray. - -

Top Version 1.221 (2001/08/07)
-
-I threatened in INSTALLATION to write an unflattering haiku -about anyone who whined that I gave them insufficient information... -but it turns out that I left out a crucial direction. D'OH! -Thanks to David Beroff for the "patch" and the haiku... - -
-       Enough info there?
-         Here's unflattering haiku:
-       Forgot the line, "make"!  ;-)
-
-

Top Version 1.220 (2001/04/03)
-
-Added untested SEEK, TELL, and EOF methods to IO::Scalar -and IO::ScalarArray to support corresponding functions for -tied filehandles: untested, because I'm still running 5.00556 -and Perl is complaining about "tell() on unopened file". -Thanks to Graham Barr for the suggestion. - - -

Removed not-fully-blank lines from modules; these were causing -lots of POD-related warnings. -Thanks to Nicolas Joly for the suggestion. - -

Top Version 1.219 (2001/02/23)
-
-IO::Scalar objects can now be made sensitive to $/ . -Pains were taken to keep the fast code fast while adding this feature. -Cheers to Graham Barr for submitting his patch; -jeers to me for losing his email for 6 months. - -

Top Version 1.218 (2001/02/23)
-
-IO::Scalar has a new sysseek() method. -Thanks again to Richard Jones. - - -

New "TO DO" section, because people who submit patches/ideas should -at least know that they're in the system... and that I won't lose -their stuff. Please read it. - - -

New entries in AUTHOR. -Please read those too. - -

Top Version 1.216 (2000/09/28)
-
-IO::Scalar and IO::ScalarArray now inherit from IO::Handle. -I thought I'd remembered a problem with this ages ago, related to -the fact that these IO:: modules don't have "real" filehandles, -but the problem apparently isn't surfacing now. -If you suddenly encounter Perl warnings during global destruction -(especially if you're using tied filehandles), then please let me know! -Thanks to B. K. Oxley (binkley) for this. - - -

Nasty bug fixed in IO::Scalar::write(). -Apparently, the offset and the number-of-bytes arguments were, -for all practical purposes, reversed. You were okay if -you did all your writing with print(), but boy was this a stupid bug! -Thanks to Richard Jones for finding this one. -For you, Rich, a double-length haiku: - -

-       Newspaper headline
-          typeset by dyslexic man
-       loses urgency
-
-
-       BABY EATS FISH is
-          simply not equivalent   
-       to FISH EATS BABY
-
- -

New sysread and syswrite methods for IO::Scalar. -Thanks again to Richard Jones for this. - -

Top Version 1.215 (2000/09/05)
-
-Added 'bool' overload to '""' overload, so object always evaluates -to true. (Whew. Glad I caught this before it went to CPAN.) - -

Top Version 1.214 (2000/09/03)
-
-Evaluating an IO::Scalar in a string context now yields -the underlying string. -Thanks to B. K. Oxley (binkley) for this. - -

Top Version 1.213 (2000/08/16)
-
-Minor documentation fixes. - -

Top Version 1.212 (2000/06/02)
-
-Fixed IO::InnerFile incompatibility with Perl5.004. -Thanks to many folks for reporting this. - -

Top Version 1.210 (2000/04/17)
-
-Added flush() and other no-op methods. -Thanks to Doru Petrescu for suggesting this. - -

Top Version 1.209 (2000/03/17)
-
-Small bug fixes. - -

Top Version 1.208 (2000/03/14)
-
-Incorporated a number of contributed patches and extensions, -mostly related to speed hacks, support for "offset", and -WRITE/CLOSE methods. -Thanks to Richard Jones, Doru Petrescu, and many others. - -

Top Version 1.206 (1999/04/18)
-
-Added creation of ./testout when Makefile.PL is run. - -

Top Version 1.205 (1999/01/15)
-
-Verified for Perl5.005. - -

Top Version 1.202 (1998/04/18)
-
-New IO::WrapTie and IO::AtomicFile added. - -

Top Version 1.110
-
-Added IO::WrapTie. - -

Top Version 1.107
-
-Added IO::Lines, and made some bug fixes to IO::ScalarArray. -Also, added getc(). - -

Top Version 1.105
-
-No real changes; just upgraded IO::Wrap to have a $VERSION string. - -
- - - -


-

Top AUTHOR

- - - -
-

Primary Maintainer
-
-Eryq (eryq@zeegee.com). -President, ZeeGee Software Inc (http://www.zeegee.com). - -

Co-Authors
-
-For all their bug reports and patch submissions, the following -are officially recognized: - -
-     Richard Jones
-     B. K. Oxley (binkley) 
-     Doru Petrescu 
-     Doug Wilson (for picking up the ball I dropped, and doing tie() right)
-
-
- - -

Go to http://www.zeegee.com for the latest downloads -and on-line documentation for this module. - - -

Enjoy. Yell if it breaks. - -


-
-Generated Sun Dec 21 13:54:37 2003 by cvu_pod2html -
-
- diff -Nru io-stringy-2.110/docs/IO/Wrap.pm.html io-stringy-2.111/docs/IO/Wrap.pm.html --- io-stringy-2.110/docs/IO/Wrap.pm.html 2003-12-21 18:54:38.000000000 +0000 +++ io-stringy-2.111/docs/IO/Wrap.pm.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,178 +0,0 @@ - - - IO::Wrap 2.102 - - -ZeeGee Software

IO::Wrap 2.102

-
- - -


-

Top NAME

- - -

IO::Wrap - wrap raw filehandles in IO::Handle interface - - - -


-

Top SYNOPSIS

- -
-   use IO::Wrap;
-       
-   ### Do stuff with any kind of filehandle (including a bare globref), or 
-   ### any kind of blessed object that responds to a print() message.
-   ###
-   sub do_stuff {
-       my $fh = shift;         
-       
-       ### At this point, we have no idea what the user gave us... 
-       ### a globref? a FileHandle? a scalar filehandle name?
-       
-       $fh = wraphandle($fh);  
-        
-       ### At this point, we know we have an IO::Handle-like object!
-       
-       $fh->print("Hey there!");
-       ...
-   }
-    
-
- - -


-

Top DESCRIPTION

- - -

Let's say you want to write some code which does I/O, but you don't -want to force the caller to provide you with a FileHandle or IO::Handle -object. You want them to be able to say: - -

-    do_stuff(\*STDOUT);
-    do_stuff('STDERR');
-    do_stuff($some_FileHandle_object);
-    do_stuff($some_IO_Handle_object);
-
- -

And even: - -

-    do_stuff($any_object_with_a_print_method);
-
- -

Sure, one way to do it is to force the caller to use tiehandle(). -But that puts the burden on them. Another way to do it is to -use IO::Wrap, which provides you with the following functions: - - - -

-

wraphandle SCALAR
-
-This function will take a single argument, and "wrap" it based on -what it seems to be... - - - -
    -

  • -

    A raw scalar filehandle name, like "STDOUT" or "Class::HANDLE". -In this case, the filehandle name is wrapped in an IO::Wrap object, -which is returned. - -

  • -

    A raw filehandle glob, like \*STDOUT. -In this case, the filehandle glob is wrapped in an IO::Wrap object, -which is returned. - -

  • -

    A blessed FileHandle object. -In this case, the FileHandle is wrapped in an IO::Wrap object if and only -if your FileHandle class does not support the read() method. - -

  • -

    Any other kind of blessed object, which is assumed to be already -conformant to the IO::Handle interface. -In this case, you just get back that object. - -

- -
- - -

If you get back an IO::Wrap object, it will obey a basic subset of -the IO:: interface. That is, the following methods (note: I said -methods, not named operators) should work on the thing you get back: - -

-    close 
-    getline 
-    getlines 
-    print ARGS...
-    read BUFFER,NBYTES
-    seek POS,WHENCE
-    tell 
-
- - -


-

Top NOTES

- - -

Clearly, when wrapping a raw external filehandle (like \*STDOUT), -I didn't want to close the file descriptor when the "wrapper" object is -destroyed... since the user might not appreciate that! Hence, -there's no DESTROY method in this class. - - -

When wrapping a FileHandle object, however, I believe that Perl will -invoke the FileHandle::DESTROY when the last reference goes away, -so in that case, the filehandle is closed if the wrapped FileHandle -really was the last reference to it. - - - -


-

Top WARNINGS

- - -

This module does not allow you to wrap filehandle names which are given -as strings that lack the package they were opened in. That is, if a user -opens FOO in package Foo, they must pass it to you either as \*FOO -or as "Foo::FOO". However, "STDIN" and friends will work just fine. - - - -


-

Top VERSION

- - -

$Id: Wrap.pm,v 2.102 2001/08/17 02:06:33 eryq Exp $ - - - - -


-

Top AUTHOR

- - -

Eryq (eryq@zeegee.com). -President, ZeeGee Software Inc (http://www.zeegee.com). - -


-
-Generated Sun Dec 21 13:54:38 2003 by cvu_pod2html -
-
- diff -Nru io-stringy-2.110/docs/IO/WrapTie.pm.html io-stringy-2.111/docs/IO/WrapTie.pm.html --- io-stringy-2.110/docs/IO/WrapTie.pm.html 2003-12-21 18:54:38.000000000 +0000 +++ io-stringy-2.111/docs/IO/WrapTie.pm.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,435 +0,0 @@ - - - IO::WrapTie 2.102 - - -ZeeGee Software

IO::WrapTie 2.102

-
- - -


-

Top NAME

- - -

IO::WrapTie - wrap tieable objects in IO::Handle interface - - -

This is currently Alpha code, released for comments. - Please give me your feedback! - - - -


-

Top SYNOPSIS

- - -

First of all, you'll need tie(), so: - -

-   require 5.004;
-
- -

Function interface (experimental). -Use this with any existing class... - -

-   use IO::WrapTie;
-   use FooHandle;                  ### implements TIEHANDLE interface
-
-
-   ### Suppose we want a "FooHandle->new(&FOO_RDWR, 2)".
-   ### We can instead say...
-
-
-   $FH = wraptie('FooHandle', &FOO_RDWR, 2); 
-
-
-   ### Now we can use...    
-   print $FH "Hello, ";            ### traditional operator syntax...
-   $FH->print("world!\n");         ### ...and OO syntax as well!
-
- -

OO interface (preferred). -You can inherit from the IO::WrapTie::Slave mixin to get a -nifty new_tie() constructor... - -

-   #------------------------------    
-   package FooHandle;                        ### a class which can TIEHANDLE
-
-
-   use IO::WrapTie;  
-   @ISA = qw(IO::WrapTie::Slave);            ### inherit new_tie()
-   ...
-
-
-   #------------------------------    
-   package main; 
-
-
-   $FH = FooHandle->new_tie(&FOO_RDWR, 2);   ### $FH is an IO::WrapTie::Master
-   print $FH "Hello, ";                      ### traditional operator syntax
-   $FH->print("world!\n");                   ### OO syntax
-
- -

See IO::Scalar as an example. It also shows you how to create classes -which work both with and without 5.004. - - - -


-

Top DESCRIPTION

- - -

Suppose you have a class FooHandle, where... - - - -

    -

  • -

    FooHandle does not inherit from IO::Handle; that is, it performs -filehandle-like I/O, but to something other than an underlying -file descriptor. Good examples are IO::Scalar (for printing to a -string) and IO::Lines (for printing to an array of lines). - -

  • -

    FooHandle implements the TIEHANDLE interface (see perltie); -that is, it provides methods TIEHANDLE, GETC, PRINT, PRINTF, -READ, and READLINE. - -

  • -

    FooHandle implements the traditional OO interface of -FileHandle and IO::Handle; i.e., it contains methods like getline(), -read(), print(), seek(), tell(), eof(), etc. - -

- - -

Normally, users of your class would have two options: - - - -

    -

  • -

    Use only OO syntax, and forsake named I/O operators like 'print'. - -

  • -

    Use with tie, and forsake treating it as a first-class object -(i.e., class-specific methods can only be invoked through the underlying -object via tied()... giving the object a "split personality"). - -

- - -

But now with IO::WrapTie, you can say: - -

-    $WT = wraptie('FooHandle', &FOO_RDWR, 2);
-    $WT->print("Hello, world\n");   ### OO syntax
-    print $WT "Yes!\n";             ### Named operator syntax too!
-    $WT->weird_stuff;               ### Other methods!
-
- -

And if you're authoring a class like FooHandle, just have it inherit -from IO::WrapTie::Slave and that first line becomes even prettier: - -

-    $WT = FooHandle->new_tie(&FOO_RDWR, 2);
-
- -

The bottom line: now, almost any class can look and work exactly like -an IO::Handle... and be used both with OO and non-OO filehandle syntax. - - - -


-

Top HOW IT ALL WORKS

- - - -


-

Top The data structures

- - -

Consider this example code, using classes in this distribution: - -

-    use IO::Scalar;
-    use IO::WrapTie;
-
-
-    $WT = wraptie('IO::Scalar',\$s);
-    print $WT "Hello, ";
-    $WT->print("world!\n");
-
- -

In it, the wraptie() function creates a data structure as follows: - -

-                          * $WT is a blessed reference to a tied filehandle
-              $WT           glob; that glob is tied to the "Slave" object.
-               |          * You would do all your i/o with $WT directly.
-               |       
-               |
-               |     ,---isa--> IO::WrapTie::Master >--isa--> IO::Handle
-               V    /
-        .-------------. 
-        |             | 
-        |             |   * Perl i/o operators work on the tied object,  
-        |  "Master"   |     invoking the TIEHANDLE methods.
-        |             |   * Method invocations are delegated to the tied 
-        |             |     slave.
-        `-------------' 
-               |    
-    tied(*$WT) |     .---isa--> IO::WrapTie::Slave
-               V    /   
-        .-------------.
-        |             |
-        |   "Slave"   |   * Instance of FileHandle-like class which doesn't
-        |             |     actually use file descriptors, like IO::Scalar.
-        |  IO::Scalar |   * The slave can be any kind of object.
-        |             |   * Must implement the TIEHANDLE interface.
-        `-------------'
-
- -

NOTE: just as an IO::Handle is really just a blessed reference to a -traditional filehandle glob... so also, an IO::WrapTie::Master -is really just a blessed reference to a filehandle -glob which has been tied to some "slave" class. - - - -


-

Top How wraptie() works

- - - -
    -

  1. -

    The call to function wraptie(SLAVECLASS, TIEARGS...) is -passed onto IO::WrapTie::Master::new(). -Note that class IO::WrapTie::Master is a subclass of IO::Handle. - -

  2. -

    The IO::WrapTie::Master::new method creates a new IO::Handle object, -reblessed into class IO::WrapTie::Master. This object is the master, -which will be returned from the constructor. At the same time... - -

  3. -

    The new method also creates the slave: this is an instance -of SLAVECLASS which is created by tying the master's IO::Handle -to SLAVECLASS via tie(HANDLE, SLAVECLASS, TIEARGS...). -This call to tie() creates the slave in the following manner: - -

  4. -

    Class SLAVECLASS is sent the message TIEHANDLE(TIEARGS...); it -will usually delegate this to SLAVECLASS::new(TIEARGS...), resulting -in a new instance of SLAVECLASS being created and returned. - -

  5. -

    Once both master and slave have been created, the master is returned -to the caller. - -

- - - -


-

Top How I/O operators work (on the master)

- - -

Consider using an i/o operator on the master: - -

-    print $WT "Hello, world!\n";   
-
- -

Since the master ($WT) is really a [blessed] reference to a glob, -the normal Perl i/o operators like print may be used on it. -They will just operate on the symbol part of the glob. - - -

Since the glob is tied to the slave, the slave's PRINT method -(part of the TIEHANDLE interface) will be automatically invoked. - - -

If the slave is an IO::Scalar, that means IO::Scalar::PRINT will be -invoked, and that method happens to delegate to the print() method -of the same class. So the real work is ultimately done by -IO::Scalar::print(). - - - -


-

Top How methods work (on the master)

- - -

Consider using a method on the master: - -

-    $WT->print("Hello, world!\n");
-
- -

Since the master ($WT) is blessed into the class IO::WrapTie::Master, -Perl first attempts to find a print() method there. Failing that, -Perl next attempts to find a print() method in the superclass, -IO::Handle. It just so happens that there is such a method; -that method merely invokes the print i/o operator on the self object... -and for that, see above! - - -

But let's suppose we're dealing with a method which isn't part -of IO::Handle... for example: - -

-    my $sref = $WT->sref;
-
- -

In this case, the intuitive behavior is to have the master delegate the -method invocation to the slave (now do you see where the designations -come from?). This is indeed what happens: IO::WrapTie::Master contains -an AUTOLOAD method which performs the delegation. - - -

So: when sref() can't be found in IO::Handle, the AUTOLOAD method -of IO::WrapTie::Master is invoked, and the standard behavior of -delegating the method to the underlying slave (here, an IO::Scalar) -is done. - - -

Sometimes, to get this to work properly, you may need to create -a subclass of IO::WrapTie::Master which is an effective master for -your class, and do the delegation there. - - - -


-

Top NOTES

- - -

Why not simply use the object's OO interface? - Because that means forsaking the use of named operators -like print(), and you may need to pass the object to a subroutine -which will attempt to use those operators: - -

-    $O = FooHandle->new(&FOO_RDWR, 2);
-    $O->print("Hello, world\n");  ### OO syntax is okay, BUT....
-
-
-    sub nope { print $_[0] "Nope!\n" }
- X  nope($O);                     ### ERROR!!! (not a glob ref)
-
- -

Why not simply use tie()? - Because (1) you have to use tied() to invoke methods in the -object's public interface (yuck), and (2) you may need to pass -the tied symbol to another subroutine which will attempt to treat -it in an OO-way... and that will break it: - -

-    tie *T, 'FooHandle', &FOO_RDWR, 2; 
-    print T "Hello, world\n";   ### Operator is okay, BUT... 
-
-
-    tied(*T)->other_stuff;      ### yuck! AND...
-
-
-    sub nope { shift->print("Nope!\n") }
- X  nope(\*T);                  ### ERROR!!! (method "print" on unblessed ref)
-
- -

Why a master and slave? - Why not simply write FooHandle to inherit from IO::Handle? - I tried this, with an implementation similar to that of IO::Socket. -The problem is that the whole point is to use this with objects -that don't have an underlying file/socket descriptor.. -Subclassing IO::Handle will work fine for the OO stuff, and fine with -named operators if you tie()... but if you just attempt to say: - -

-    $IO = FooHandle->new(&FOO_RDWR, 2);
-    print $IO "Hello!\n";
-
- -

you get a warning from Perl like: - -

-    Filehandle GEN001 never opened
-
- -

because it's trying to do system-level i/o on an (unopened) file -descriptor. To avoid this, you apparently have to tie() the handle... -which brings us right back to where we started! At least the -IO::WrapTie mixin lets us say: - -

-    $IO = FooHandle->new_tie(&FOO_RDWR, 2);
-    print $IO "Hello!\n";
-
- -

and so is not too bad. :-) - - - -


-

Top WARNINGS

- - -

Remember: this stuff is for doing FileHandle-like i/o on things -without underlying file descriptors. If you have an underlying -file descriptor, you're better off just inheriting from IO::Handle. - - -

Be aware that new_tie() always returns an instance of a -kind of IO::WrapTie::Master... it does not return an instance -of the i/o class you're tying to! - - -

Invoking some methods on the master object causes AUTOLOAD to delegate -them to the slave object... so it looks like you're manipulating a -"FooHandle" object directly, but you're not. - - -

I have not explored all the ramifications of this use of tie(). -Here there be dragons. - - - -


-

Top VERSION

- - -

$Id: WrapTie.pm,v 2.102 2001/08/17 02:06:33 eryq Exp $ - - - -


-

Top AUTHOR

- - -

Eryq (eryq@zeegee.com). -President, ZeeGee Software Inc (http://www.zeegee.com). - -


-
-Generated Sun Dec 21 13:54:38 2003 by cvu_pod2html -
-
- diff -Nru io-stringy-2.110/docs/IO_Scalar_synopsis.html io-stringy-2.111/docs/IO_Scalar_synopsis.html --- io-stringy-2.110/docs/IO_Scalar_synopsis.html 2003-12-21 18:54:38.000000000 +0000 +++ io-stringy-2.111/docs/IO_Scalar_synopsis.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - - IO_Scalar_synopsis - - -ZeeGee Software

IO_Scalar_synopsis

-
- - -


-

Top NAME

- - -

IO_Scalar_synopsis - test out IO::Scalar - - - -


-

Top SYNOPSIS

- -
-    ### From our distribution's top level directory:
-    perl -I./lib examples/IO_Scalar_synopsis 
-
-


-
-Generated Sun Dec 21 13:54:38 2003 by cvu_pod2html -
-
- diff -Nru io-stringy-2.110/lib/IO/AtomicFile.pm io-stringy-2.111/lib/IO/AtomicFile.pm --- io-stringy-2.110/lib/IO/AtomicFile.pm 2005-02-10 21:21:53.000000000 +0000 +++ io-stringy-2.111/lib/IO/AtomicFile.pm 2015-04-22 17:26:15.000000000 +0000 @@ -17,7 +17,7 @@ use vars qw($VERSION @ISA); # The package version, both in 1.23 style *and* usable by MakeMaker: -$VERSION = "2.110"; +$VERSION = "2.111"; # Inheritance: @ISA = qw(IO::File); @@ -86,10 +86,13 @@ sub close { my ($self, $die) = @_; unless ($self->_closed(1)) { ### sentinel... - $self->SUPER::close(); - rename(${*$self}{'io_atomicfile_temp'}, - ${*$self}{'io_atomicfile_path'}) - or ($die ? die "close atomic file: $!\n" : return undef); + if ($self->SUPER::close()) { + rename(${*$self}{'io_atomicfile_temp'}, + ${*$self}{'io_atomicfile_path'}) + or ($die ? die "close (rename) atomic file: $!\n" : return undef); + } else { + ($die ? die "close atomic file: $!\n" : return undef); + } } 1; } @@ -174,14 +177,14 @@ fails. The explicit close() just returns undef. You can also decide at any point to trash the file you've been -building. +building. =head1 AUTHOR =head2 Primary Maintainer -David F. Skoll (F). +Dianne Skoll (F). =head2 Original Author diff -Nru io-stringy-2.110/lib/IO/InnerFile.pm io-stringy-2.111/lib/IO/InnerFile.pm --- io-stringy-2.110/lib/IO/InnerFile.pm 2005-02-10 21:21:53.000000000 +0000 +++ io-stringy-2.111/lib/IO/InnerFile.pm 2015-04-22 17:26:14.000000000 +0000 @@ -30,7 +30,7 @@ use Symbol; # The package version, both in 1.23 style *and* usable by MakeMaker: -$VERSION = "2.110"; +$VERSION = "2.111"; #------------------------------ @@ -146,10 +146,12 @@ sub print { shift->PRINT(@_) } sub printf { shift->PRINTF(@_) } sub flush { "0 but true"; } +sub fileno { } sub binmode { 1; } sub getc { return GETC(tied(${$_[0]}) ); } sub read { return READ( tied(${$_[0]}), @_[1,2,3] ); } sub readline { return READLINE( tied(${$_[0]}) ); } + sub getline { return READLINE( tied(${$_[0]}) ); } sub close { return CLOSE(tied(${$_[0]}) ); } @@ -226,10 +228,27 @@ return $lg; } -sub READLINE { +sub READLINE { + my ($self) = @_; + return $self->_readline_helper() unless wantarray; + my @arr; + while(defined(my $line = $self->_readline_helper())) { + push(@arr, $line); + } + return @arr; +} + +sub _readline_helper { my ($self) = @_; return undef if ($self->{CRPOS} >= $self->{LG}); + # Handle slurp mode (CPAN ticket #72710) + if (! defined($/)) { + my $text; + $self->READ($text, $self->{LG} - $self->{CRPOS}); + return $text; + } + ### Save and seek... my $old_pos = $self->{FH}->tell; $self->{FH}->seek($self->{CRPOS}+$self->{START}, 0); @@ -275,7 +294,7 @@ Documentation and by Eryq (eryq@zeegee.com). -Currently maintained by David F. Skoll (dfs@roaringpenguin.com). +Currently maintained by Dianne Skoll (dfs@roaringpenguin.com). =cut diff -Nru io-stringy-2.110/lib/IO/Lines.pm io-stringy-2.111/lib/IO/Lines.pm --- io-stringy-2.110/lib/IO/Lines.pm 2005-02-10 21:21:53.000000000 +0000 +++ io-stringy-2.111/lib/IO/Lines.pm 2015-04-22 17:26:14.000000000 +0000 @@ -40,7 +40,7 @@ use vars qw($VERSION @ISA); # The package version, both in 1.23 style *and* usable by MakeMaker: -$VERSION = "2.110"; +$VERSION = "2.111"; # Inheritance: @ISA = qw(IO::ScalarArray); ### also gets us new_tie :-) @@ -161,7 +161,7 @@ =head2 Primary Maintainer -David F. Skoll (F). +Dianne Skoll (F). =head2 Principal author diff -Nru io-stringy-2.110/lib/IO/ScalarArray.pm io-stringy-2.111/lib/IO/ScalarArray.pm --- io-stringy-2.110/lib/IO/ScalarArray.pm 2005-02-10 21:21:53.000000000 +0000 +++ io-stringy-2.111/lib/IO/ScalarArray.pm 2015-04-22 17:26:15.000000000 +0000 @@ -150,7 +150,7 @@ use IO::Handle; # The package version, both in 1.23 style *and* usable by MakeMaker: -$VERSION = "2.110"; +$VERSION = "2.111"; # Inheritance: @ISA = qw(IO::Handle); @@ -270,6 +270,17 @@ #------------------------------ +=item fileno + +I +No-op, returns undef + +=cut + +sub fileno { } + +#------------------------------ + =item getc I @@ -300,7 +311,7 @@ ### Minimal impact implementation! - ### We do the fast fast thing (no regexps) if using the + ### We do the fast thing (no regexps) if using the ### classic input record separator. ### Case 1: $/ is undef: slurp all... @@ -323,7 +334,7 @@ ### Case 2: $/ is "\n": elsif ($/ eq "\012") { - ### Until we hit EOF (or exitted because of a found line): + ### Until we hit EOF (or exited because of a found line): until ($self->eof) { ### If at end of current string, go fwd to next one (won't be EOF): if ($self->_eos) {++*$self->{Str}, *$self->{Pos}=0}; @@ -710,6 +721,7 @@ sub SEEK { shift->seek(@_); } sub TELL { shift->tell(@_); } sub EOF { shift->eof(@_); } +sub BINMODE { 1; } #------------------------------------------------------------ @@ -759,7 +771,7 @@ =head2 Primary Maintainer -David F. Skoll (F). +Dianne Skoll (F). =head2 Principal author diff -Nru io-stringy-2.110/lib/IO/Scalar.pm io-stringy-2.111/lib/IO/Scalar.pm --- io-stringy-2.110/lib/IO/Scalar.pm 2005-02-10 21:21:53.000000000 +0000 +++ io-stringy-2.111/lib/IO/Scalar.pm 2015-04-22 17:26:12.000000000 +0000 @@ -158,7 +158,7 @@ use overload 'bool' => sub { 1 }; ### have to do this, so object is true! ### The package version, both in 1.23 style *and* usable by MakeMaker: -$VERSION = "2.110"; +$VERSION = "2.111"; ### Inheritance: @ISA = qw(IO::Handle); @@ -279,6 +279,17 @@ #------------------------------ +=item fileno + +I +No-op, returns undef + +=cut + +sub fileno { } + +#------------------------------ + =item getc I @@ -316,7 +327,7 @@ my $i = *$self->{Pos}; ### Start matching at this point. ### Minimal impact implementation! - ### We do the fast fast thing (no regexps) if using the + ### We do the fast thing (no regexps) if using the ### classic input record separator. ### Case 1: $/ is undef: slurp all... @@ -619,7 +630,7 @@ # use_RS [YESNO] # # I -# Obey the curent setting of $/, like IO::Handle does? +# Obey the current setting of $/, like IO::Handle does? # Default is false in 1.x, but cold-welded true in 2.x and later. # sub use_RS { @@ -682,6 +693,7 @@ sub SEEK { shift->seek(@_); } sub TELL { shift->tell(@_); } sub EOF { shift->eof(@_); } +sub BINMODE { 1; } #------------------------------------------------------------ @@ -725,7 +737,7 @@ =head2 Primary Maintainer -David F. Skoll (F). +Dianne Skoll (F). =head2 Principal author diff -Nru io-stringy-2.110/lib/IO/Stringy.pm io-stringy-2.111/lib/IO/Stringy.pm --- io-stringy-2.110/lib/IO/Stringy.pm 2005-02-10 21:24:05.000000000 +0000 +++ io-stringy-2.111/lib/IO/Stringy.pm 2015-04-22 17:26:15.000000000 +0000 @@ -1,7 +1,7 @@ package IO::Stringy; use vars qw($VERSION); -$VERSION = "2.110"; +$VERSION = "2.111"; 1; __END__ @@ -417,7 +417,7 @@ =item Primary Maintainer -David F. Skoll (F). +Dianne Skoll (F). =item Original Author diff -Nru io-stringy-2.110/lib/IO/Wrap.pm io-stringy-2.111/lib/IO/Wrap.pm --- io-stringy-2.110/lib/IO/Wrap.pm 2005-02-10 21:21:53.000000000 +0000 +++ io-stringy-2.111/lib/IO/Wrap.pm 2015-04-22 17:26:15.000000000 +0000 @@ -13,7 +13,7 @@ use Carp; # The package version, both in 1.23 style *and* usable by MakeMaker: -$VERSION = "2.110"; +$VERSION = "2.111"; #------------------------------ @@ -49,6 +49,12 @@ my $self = shift; return close($$self); } +sub fileno { + my $self = shift; + my $fh = $$self; + return fileno($fh); +} + sub getline { my $self = shift; my $fh = $$self; @@ -211,7 +217,7 @@ =item Primary Maintainer -David F. Skoll (F). +Dianne Skoll (F). =item Original Author diff -Nru io-stringy-2.110/lib/IO/WrapTie.pm io-stringy-2.111/lib/IO/WrapTie.pm --- io-stringy-2.110/lib/IO/WrapTie.pm 2005-02-10 21:21:53.000000000 +0000 +++ io-stringy-2.111/lib/IO/WrapTie.pm 2015-04-22 17:26:14.000000000 +0000 @@ -12,7 +12,7 @@ # Inheritance, exporting, and package version: @ISA = qw(Exporter); @EXPORT = qw(wraptie); -$VERSION = "2.110"; +$VERSION = "2.111"; # Function, exported. sub wraptie { @@ -480,7 +480,7 @@ =item Primary Maintainer -David F. Skoll (F). +Dianne Skoll (F). =item Original Author diff -Nru io-stringy-2.110/MANIFEST io-stringy-2.111/MANIFEST --- io-stringy-2.110/MANIFEST 2005-02-10 21:22:10.000000000 +0000 +++ io-stringy-2.111/MANIFEST 2011-03-02 16:24:00.000000000 +0000 @@ -14,6 +14,7 @@ lib/IO/WrapTie.pm t/Common.pm t/ExtUtils/TBone.pm +t/IO_InnerFile.t t/IO_Lines.t t/IO_Scalar.t t/IO_ScalarArray.t diff -Nru io-stringy-2.110/META.yml io-stringy-2.111/META.yml --- io-stringy-2.110/META.yml 2005-02-10 20:08:29.000000000 +0000 +++ io-stringy-2.111/META.yml 2015-04-22 17:26:51.000000000 +0000 @@ -1,10 +1,20 @@ -# http://module-build.sourceforge.net/META-spec.html -#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# -name: IO-stringy -version: 2.110 -version_from: lib/IO/Stringy.pm -installdirs: site -requires: - -distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.17 +--- #YAML:1.0 +name: IO-stringy +version: 2.111 +abstract: ~ +author: [] +license: unknown +distribution_type: module +configure_requires: + ExtUtils::MakeMaker: 0 +build_requires: + ExtUtils::MakeMaker: 0 +requires: {} +no_index: + directory: + - t + - inc +generated_by: ExtUtils::MakeMaker version 6.57_05 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 diff -Nru io-stringy-2.110/README io-stringy-2.111/README --- io-stringy-2.110/README 2005-02-10 21:24:05.000000000 +0000 +++ io-stringy-2.111/README 2015-04-22 17:25:41.000000000 +0000 @@ -94,6 +94,10 @@ like an IO::Scalar in its use of globrefs. CHANGE LOG + Version 2.111 (2015/04/22) + + Update maintainer's name, which is now Dianne Skoll. + Version 2.110 (2005/02/10) Maintainership taken over by DSKOLL @@ -289,7 +293,7 @@ AUTHOR Primary Maintainer - David F. Skoll (dfs@roaringpenguin.com). + Dianne Skoll (dfs@roaringpenguin.com). Original Author Eryq (eryq@zeegee.com). President, ZeeGee Software Inc diff -Nru io-stringy-2.110/t/IO_InnerFile.t io-stringy-2.111/t/IO_InnerFile.t --- io-stringy-2.110/t/IO_InnerFile.t 1970-01-01 00:00:00.000000000 +0000 +++ io-stringy-2.111/t/IO_InnerFile.t 2011-11-25 16:25:47.000000000 +0000 @@ -0,0 +1,75 @@ +#!/usr/bin/perl -w #-*-Perl-*- + +use lib "./t", "./lib"; +use IO::InnerFile; +use IO::File; + +use ExtUtils::TBone; +use Common; + + +#-------------------- +# +# TEST... +# +#-------------------- + +# Make a tester: +my $T = typical ExtUtils::TBone; +Common->test_init(TBone=>$T); + +$T->begin(7); + +# Create a test file +open(OUT, '>t/dummy-test-file') || die("Cannot write t/dummy-test-file: $!"); +print OUT <<'EOF'; +Here is some dummy content. +Here is some more dummy content +Here is yet more dummy content. +And finally another line. +EOF +close(OUT); + +# Open it as a regular file handle +my $fh = IO::File->new('new($fh, 28, 64); # Second and third lines + +my $line; +$line = <$inner>; +$T->ok_eq($line, "Here is some more dummy content\n"); +$line = <$inner>; +$T->ok_eq($line, "Here is yet more dummy content.\n"); +$line = <$inner>; +$T->ok(!defined($line)); + +$inner->close(); + +$inner = IO::InnerFile->new($fh, 28, 64); # Second and third lines + +# Test list context (CPAN ticket #66186) +my @arr; +@arr = <$inner>; +$T->ok(scalar(@arr) == 2); +$T->ok_eq($arr[0], "Here is some more dummy content\n"); +$T->ok_eq($arr[1], "Here is yet more dummy content.\n"); + +# Make sure slurp mode works as expected +$inner->seek(0, 0); +{ + local $/; + my $contents = <$inner>; + $T->ok_eq($contents, "Here is some more dummy content\nHere is yet more dummy content.\n"); +} + +# So we know everything went well... +$T->end; +unlink('t/dummy-test-file'); + + + + + + + + diff -Nru io-stringy-2.110/t/IO_ScalarArray.t io-stringy-2.111/t/IO_ScalarArray.t --- io-stringy-2.110/t/IO_ScalarArray.t 2001-08-09 08:00:46.000000000 +0000 +++ io-stringy-2.111/t/IO_ScalarArray.t 2011-05-17 15:51:51.000000000 +0000 @@ -20,7 +20,7 @@ Common->test_init(TBone=>$T); # Set the counter: -my $main_tests = 1; +my $main_tests = 1+1; my $common_tests = (1 + 1 + 4 + 4 + 3 + 4 + Common->test_recordsep_count($RECORDSEP_TESTS)); $T->begin($main_tests + $common_tests); @@ -29,6 +29,7 @@ my @sa = @Common::DATA_SA; my $SAH = IO::ScalarArray->new(\@sa); $T->ok($SAH, "OPEN: open a scalar on a ref to an array"); +$T->ok(!defined($SAH->fileno()), 'fileno() returns undef'); # Run standard tests: Common->test_print($SAH); diff -Nru io-stringy-2.110/t/IO_Scalar.t io-stringy-2.111/t/IO_Scalar.t --- io-stringy-2.110/t/IO_Scalar.t 2001-08-09 07:42:40.000000000 +0000 +++ io-stringy-2.111/t/IO_Scalar.t 2011-05-17 15:51:51.000000000 +0000 @@ -21,7 +21,7 @@ $T->log_warnings; ### Set the counter: -my $main_tests = 1 + 1; +my $main_tests = 1 + 1 + 1; my $common_tests = (1 + 1 + 4 + 4 + 3 + 4 + Common->test_recordsep_count($RECORDSEP_TESTS)); $T->begin($main_tests + $common_tests); @@ -31,6 +31,9 @@ my $SH = IO::Scalar->new(\$s); $T->ok($SH, "OPEN: open a scalar on a ref to a string"); +### Make sure fileno does not die +$T->ok(!defined($SH->fileno()), "fileno() returns undef"); + ### Run standard tests: Common->test_print($SH); $T->ok(($s eq $Common::FDATA_S), "FULL",