Skip to content

Commit 02531f1

Browse files
EryqOuithaqueueschwern
authored andcommitted
import IO-stringy 2.105 from CPAN
git-cpan-module: IO-stringy git-cpan-version: 2.105 git-cpan-authorid: ERYQ git-cpan-file: authors/id/E/ER/ERYQ/IO-stringy-2.105.tar.gz
1 parent 186c8d3 commit 02531f1

31 files changed

+1806
-592
lines changed

COPYING

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
The "IO-stringy" Perl5 toolkit.
2+
Copyright (c) 1996 by Eryq. All rights reserved.
3+
Copyright (c) 1999,2001 by ZeeGee Software Inc. All rights reserved.
4+
5+
This program is free software; you can redistribute it and/or
6+
modify it under the same terms as Perl itself.
7+
8+
You should have received a copy of the Perl license along with
9+
Perl; see the file README in Perl distribution.
10+
11+
You should have received a copy of the GNU General Public License
12+
along with Perl; see the file Copying. If not, write to
13+
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
14+
15+
You should have received a copy of the Artistic License
16+
along with Perl; see the file Artistic.
17+
18+
NO WARRANTY
19+
20+
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
21+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
22+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
23+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
24+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
26+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
27+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
28+
REPAIR OR CORRECTION.
29+
30+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
31+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
32+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
33+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
34+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
35+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
36+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
37+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
38+
POSSIBILITY OF SUCH DAMAGES.
39+
40+
END OF TERMS AND CONDITIONS

MANIFEST

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
COPYING
12
MANIFEST
23
Makefile.PL
34
README
@@ -16,6 +17,7 @@ docs/IO/icons/zeegee.gif
1617
docs/index-menu.html
1718
docs/index.html
1819
docs/index.menu
20+
examples/IO_Scalar_synopsis
1921
lib/IO/AtomicFile.pm
2022
lib/IO/InnerFile.pm
2123
lib/IO/Lines.pm
@@ -30,3 +32,5 @@ t/IO_Lines.t
3032
t/IO_Scalar.t
3133
t/IO_ScalarArray.t
3234
t/IO_WrapTie.t
35+
t/simple.t
36+
t/two.t

Makefile.PL

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ WriteMakefile(
1414
VERSION_FROM => "lib/IO/Stringy.pm",
1515
DISTNAME => "IO-stringy",
1616
'dist' => {
17-
PREOP => "cvu_perl_preop -m IO::Stringy -f",
17+
PREOP => "cvu_perl_preop -m IO::Stringy -f -A",
1818
COMPRESS => 'gzip',
1919
SUFFIX => 'gz',
2020
}

README

+106-9
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ DESCRIPTION
1515
and object-oriented i/o) on things *other* than normal filehandles; in
1616
particular, IO::Scalar, IO::ScalarArray, and IO::Lines.
1717

18-
If you have access to tie(), these classes will make use of the
19-
IO::WrapTie module to inherit a convenient new_tie() constructor. It
20-
also exports a nice wraptie() function.
21-
2218
In the more-traditional IO::Handle front, we have IO::AtomicFile which
2319
may be used to painlessly create files which are updated atomically.
2420

@@ -28,10 +24,37 @@ DESCRIPTION
2824
and stop worrying about whether your function's caller handed you a
2925
string, a globref, or a FileHandle.
3026

27+
WARNINGS
28+
Perl's TIEHANDLE spec was incomplete prior to 5.005_57; it was missing
29+
support for `seek()', `tell()', and `eof()'. Attempting to use these
30+
functions with an IO::Scalar, IO::ScalarArray, IO::Lines, etc. will not
31+
work prior to 5.005_57. None of the relevant methods will be invoked by
32+
Perl; and even worse, this kind of bug can lie dormant for a while. If
33+
you turn warnings on (via `$^W' or `perl -w'), and you see something
34+
like this...
35+
36+
seek() on unopened file
37+
38+
...then you are probably trying to use one of these functions on one of
39+
our IO:: classes with an old Perl. The remedy is to simply use the OO
40+
version; e.g.:
41+
42+
$SH->seek(0,0); ### GOOD: will work on any 5.005
43+
seek($SH,0,0); ### WARNING: will only work on 5.005_57 and beyond
44+
3145
INSTALLATION
46+
Requirements
47+
48+
As of version 2.x, this toolkit requires Perl 5.005 for the IO::Handle
49+
subclasses, and 5.005_57 or better is strongly recommended. See the
50+
section on "WARNINGS" for details.
51+
52+
Directions
53+
3254
Most of you already know the drill...
3355

3456
perl Makefile.PL
57+
make
3558
make test
3659
make install
3760

@@ -54,7 +77,7 @@ INSTALLATION
5477
them in the next change log. I'll do it. Don't think I won't.
5578

5679
VERSION
57-
$Id: Stringy.pm,v 1.220 2001/04/04 05:37:51 eryq Exp $
80+
$Id: Stringy.pm,v 2.105 2001/08/09 08:08:32 eryq Exp $
5881

5982
TO DO
6083
(2000/08/02) Finalize $/ support
@@ -63,7 +86,8 @@ TO DO
6386
experimental implementation done.
6487

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

6892
(2000/09/28) Separate read/write cursors?
6993
Binkley sent me a very interesting variant of IO::Scalar which
@@ -74,17 +98,89 @@ TO DO
7498
maintain an independent read and write file position (and
7599
seek(2) resets them both)?
76100

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

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

82108
Your opinions on this are most welcome. (Me, I'm just squeamish that
83109
this will break some code which depends on the existing behavior,
84110
and that attempts to maintain backwards-compatibility will slow down
85-
the code. But I'll give it a shot.)
111+
the code.)
112+
113+
(2001/08/08) Remove IO::WrapTie from new IO:: classes
114+
It's not needed. Backwards compatibility could be maintained by
115+
having new_tie() be identical to new(). Heck, I'll bet that
116+
IO::WrapTie should be reimplemented so the returned object is just
117+
like an IO::Scalar in its use of globrefs.
86118

87119
CHANGE LOG
120+
Version 2.105 (2001/08/09)
121+
Added support for various seek() whences to IO::ScalarArray.
122+
123+
Added support for consulting $/ in IO::Scalar and IO::ScalarArray.
124+
The old `use_RS()' is not even an option. Unsupported record
125+
separators will cause a croak().
126+
127+
Added a lot of regression tests to supoprt the above.
128+
129+
Better on-line docs (hyperlinks to individual functions).
130+
131+
Version 2.103 (2001/08/08)
132+
After sober consideration I have reimplemented IO::Scalar::print()
133+
so that it once again always seeks to the end of the string.
134+
Benchmarks show the new implementation to be just as fast as
135+
Juergen's contributed patch; until someone can convince me
136+
otherwise, the current, safer implementation stays.
137+
138+
I thought more about giving IO::Scalar two separate handles, one for
139+
reading and one for writing, as suggested by Binkley. His points
140+
about what tell() and eof() return are, I think, show-stoppers for
141+
this feature. Even the manpages for stdio's fseek() seem to imply a
142+
*single* file position indicator, not two. So I think I will take
143+
this off the TO DO list. Remedy: you can always have two handles
144+
open on the same scalar, one which you only write to, and one which
145+
you only read from. That should give the same effect.
146+
147+
Version 2.101 (2001/08/07)
148+
Alpha release. This is the initial release of the "IO::Scalar and
149+
friends are now subclasses of IO::Handle". I'm flinging it against
150+
the wall. Please tell me if the banana sticks. When it does, the
151+
banana will be called 2.2x.
152+
153+
First off, *many many thanks to Doug Wilson*, who has provided an
154+
*invaluable* service by patching IO::Scalar and friends so that they
155+
(1) inherit from IO::Handle, (2) automatically tie themselves so
156+
that the `new()' objects can be used in native i/o constructs, and
157+
(3) doing it so that the whole damn thing passes its regression
158+
tests. As Doug knows, my globref Kung-Fu was not up to the task; he
159+
graciously provided the patches. This has earned him a seat at the
160+
Co-Authors table, and the right to have me address him as *sensei*.
161+
162+
Performance of IO::Scalar::print() has been improved by as much as
163+
2x for lots of little prints, with the cost of forcing those who
164+
print-then-seek-then-print to explicitly seek to end-of-string
165+
before printing again. *Thanks to Juergen Zeller for this patch.*
166+
167+
Added the COPYING file, which had been missing from prior versions.
168+
*Thanks to Albert Chin-A-Young for pointing this out.*
169+
170+
IO::Scalar consults $/ by default (1.x ignored it by default). Yes,
171+
I still need to support IO::ScalarArray.
172+
173+
Version 1.221 (2001/08/07)
174+
I threatened in the section on "INSTALLATION" to write an
175+
unflattering haiku about anyone who whined that I gave them
176+
insufficient information... but it turns out that I left out a
177+
crucial direction. D'OH! *Thanks to David Beroff for the "patch" and
178+
the haiku...*
179+
180+
Enough info there?
181+
Here's unflattering haiku:
182+
Forgot the line, "make"! ;-)
183+
88184
Version 1.220 (2001/04/03)
89185
Added untested SEEK, TELL, and EOF methods to IO::Scalar and
90186
IO::ScalarArray to support corresponding functions for tied
@@ -189,13 +285,14 @@ AUTHOR
189285
Eryq ([email protected]). President, ZeeGee Software Inc
190286
(http://www.zeegee.com).
191287

192-
Unofficial Co-Authors
288+
Co-Authors
193289
For all their bug reports and patch submissions, the following are
194290
officially recognized:
195291

196292
Richard Jones
197293
B. K. Oxley (binkley)
198294
Doru Petrescu
295+
Doug Wilson (for picking up the ball I dropped, and doing tie() right)
199296

200297
Enjoy. Yell if it breaks.
201298

README.system

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ DEVELOPMENT PERL:
55
This is perl, version 5.005_56 built for i586-linux
66

77
DEVELOPMENT DATE:
8-
Wed Apr 4 01:38:38 EDT 2001
8+
Thu Aug 9 04:09:45 EDT 2001

docs/IO/AtomicFile.pm.html

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<BODY
66
bgcolor="#FFFFFF" link="#CC3366" vlink="#993366" alink="#FF6666">
77
<FONT FACE="sans-serif" SIZE=-1><A HREF="http://www.zeegee.com" TARGET="_top"><IMG SRC="icons/zeegee.gif" ALT="ZeeGee Software" ALIGN="RIGHT" BORDER="0"></A><A NAME="__TOP__"><H1>IO::AtomicFile</H1>
8-
</A><UL>
8+
</A>
9+
<P><B>This module is <FONT COLOR="#990000">ALPHA</FONT> code, which means that public interfaces are largely untested, and may change in future releases. Use with caution! Please report any errors back to <A HREF="mailto:[email protected]">[email protected]</A> as soon as you can.</B><UL>
910
<LI> <A HREF="#NAME">NAME</A>
1011
<LI> <A HREF="#SYNOPSIS">SYNOPSIS</A>
1112
<LI> <A HREF="#DESCRIPTION">DESCRIPTION</A>
@@ -29,19 +30,19 @@
2930
use IO::AtomicFile;
3031
</PRE></FONT>
3132
<FONT SIZE=3 FACE="courier"><PRE>
32-
# Write a temp file, and have it install itself when closed:
33+
### Write a temp file, and have it install itself when closed:
3334
my $FH = IO::AtomicFile-&gt;open(&quot;bar.dat&quot;, &quot;w&quot;);
3435
print $FH &quot;Hello!\n&quot;;
3536
$FH-&gt;close || die &quot;couldn't install atomic file: $!&quot;;
3637
</PRE></FONT>
3738
<FONT SIZE=3 FACE="courier"><PRE>
38-
# Write a temp file, but delete it before it gets installed:
39+
### Write a temp file, but delete it before it gets installed:
3940
my $FH = IO::AtomicFile-&gt;open(&quot;bar.dat&quot;, &quot;w&quot;);
4041
print $FH &quot;Hello!\n&quot;;
4142
$FH-&gt;delete;
4243
</PRE></FONT>
4344
<FONT SIZE=3 FACE="courier"><PRE>
44-
# Write a temp file, but neither install it nor delete it:
45+
### Write a temp file, but neither install it nor delete it:
4546
my $FH = IO::AtomicFile-&gt;open(&quot;bar.dat&quot;, &quot;w&quot;);
4647
print $FH &quot;Hello!\n&quot;;
4748
$FH-&gt;detach;
@@ -94,11 +95,11 @@
9495
<A NAME="REVISION"><H2><A HREF="#__TOP__"><IMG SRC="icons/h1bullet.gif" ALT="Top" BORDER="0"></A> REVISION</H2></A>
9596

9697

97-
<P>$Revision: 1.106 $
98+
<P>$Revision: 2.101 $
9899

99100
<P><HR>
100101
<ADDRESS><FONT SIZE=-1>
101-
Generated Wed Apr 4 01:38:08 2001 by cvu_pod2html
102+
Generated Thu Aug 9 04:09:17 2001 by cvu_pod2html
102103
</FONT></ADDRESS>
103104
</FONT></BODY>
104105
</HTML>

docs/IO/InnerFile.pm.html

+24-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,33 @@
55
<BODY
66
bgcolor="#FFFFFF" link="#CC3366" vlink="#993366" alink="#FF6666">
77
<FONT FACE="sans-serif" SIZE=-1><A HREF="http://www.zeegee.com" TARGET="_top"><IMG SRC="icons/zeegee.gif" ALT="ZeeGee Software" ALIGN="RIGHT" BORDER="0"></A><A NAME="__TOP__"><H1>IO::InnerFile</H1>
8-
</A><UL>
8+
</A>
9+
<P><B>This module is <FONT COLOR="#990000">ALPHA</FONT> code, which means that public interfaces are largely untested, and may change in future releases. Use with caution! Please report any errors back to <A HREF="mailto:[email protected]">[email protected]</A> as soon as you can.</B><UL>
910
<LI> <A HREF="#NAME">NAME</A>
1011
<LI> <A HREF="#SYNOPSIS">SYNOPSIS</A>
1112
<LI> <A HREF="#DESCRIPTION">DESCRIPTION</A>
1213
<LI> <A HREF="#PUBLIC_INTERFACE">PUBLIC INTERFACE</A>
14+
<UL>
15+
<LI> <A HREF="#item:new">new FILEHANDLE, [START, [LENGTH]]</A>
16+
<LI> <A HREF="#item:set_length">set_length LENGTH</A>
17+
<LI> <A HREF="#item:get_length">get_length </A>
18+
<LI> <A HREF="#item:add_length">add_length NBYTES</A>
19+
<LI> <A HREF="#item:set_start">set_start START</A>
20+
<LI> <A HREF="#item:get_start">get_start </A>
21+
<LI> <A HREF="#item:add_start">add_start NBYTES</A>
22+
<LI> <A HREF="#item:binmode">binmode</A>
23+
<LI> <A HREF="#item:close">close</A>
24+
<LI> <A HREF="#item:flush">flush</A>
25+
<LI> <A HREF="#item:getc">getc</A>
26+
<LI> <A HREF="#item:getline">getline</A>
27+
<LI> <A HREF="#item:print">print LIST</A>
28+
<LI> <A HREF="#item:printf">printf LIST</A>
29+
<LI> <A HREF="#item:read">read BUF, NBYTES</A>
30+
<LI> <A HREF="#item:readline">readline</A>
31+
<LI> <A HREF="#item:seek">seek OFFFSET, WHENCE</A>
32+
<LI> <A HREF="#item:tell">tell</A>
33+
<LI> <A HREF="#item:write">write ARGS...</A>
34+
</UL>
1335
<LI> <A HREF="#AUTHOR">AUTHOR</A>
1436
</UL>
1537
</A>
@@ -120,7 +142,7 @@
120142

121143
<P><HR>
122144
<ADDRESS><FONT SIZE=-1>
123-
Generated Wed Apr 4 01:38:12 2001 by cvu_pod2html
145+
Generated Thu Aug 9 04:09:22 2001 by cvu_pod2html
124146
</FONT></ADDRESS>
125147
</FONT></BODY>
126148
</HTML>

docs/IO/Lines.pm.html

+10-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<BODY
66
bgcolor="#FFFFFF" link="#CC3366" vlink="#993366" alink="#FF6666">
77
<FONT FACE="sans-serif" SIZE=-1><A HREF="http://www.zeegee.com" TARGET="_top"><IMG SRC="icons/zeegee.gif" ALT="ZeeGee Software" ALIGN="RIGHT" BORDER="0"></A><A NAME="__TOP__"><H1>IO::Lines</H1>
8-
</A><UL>
8+
</A>
9+
<P><B>This module is <FONT COLOR="#990000">ALPHA</FONT> code, which means that public interfaces are largely untested, and may change in future releases. Use with caution! Please report any errors back to <A HREF="mailto:[email protected]">[email protected]</A> as soon as you can.</B><UL>
910
<LI> <A HREF="#NAME">NAME</A>
1011
<LI> <A HREF="#SYNOPSIS">SYNOPSIS</A>
1112
<LI> <A HREF="#DESCRIPTION">DESCRIPTION</A>
@@ -33,7 +34,7 @@
3334
use IO::Lines;
3435
</PRE></FONT>
3536
<FONT SIZE=3 FACE="courier"><PRE>
36-
# See IO::ScalarArray for details
37+
### See IO::ScalarArray for details
3738
</PRE></FONT>
3839

3940

@@ -59,15 +60,15 @@
5960
newlines appropriately.
6061

6162

62-
<P>See <A HREF="../IO/ScalarArray.pm.html">IO::ScalarArray</A> for full usage.
63+
<P>See <A HREF="../IO/ScalarArray.pm.html">IO::ScalarArray</A> for full usage and warnings.
6364

6465

6566

6667
<P><HR>
6768
<A NAME="VERSION"><H2><A HREF="#__TOP__"><IMG SRC="icons/h1bullet.gif" ALT="Top" BORDER="0"></A> VERSION</H2></A>
6869

6970

70-
<P>$Id: Lines.pm,v 1.111 2001/04/04 05:37:51 eryq Exp $
71+
<P>$Id: Lines.pm,v 2.103 2001/08/09 08:04:44 eryq Exp $
7172

7273

7374

@@ -96,9 +97,13 @@
9697
<P><I>Morris M. Siegel,</I>
9798
for his $/ patch and the new <CODE>getlines()</CODE>.
9899

100+
101+
<P><I>Doug Wilson,</I>
102+
for the IO::Handle inheritance and automatic tie-ing.
103+
99104
<P><HR>
100105
<ADDRESS><FONT SIZE=-1>
101-
Generated Wed Apr 4 01:38:18 2001 by cvu_pod2html
106+
Generated Thu Aug 9 04:09:26 2001 by cvu_pod2html
102107
</FONT></ADDRESS>
103108
</FONT></BODY>
104109
</HTML>

0 commit comments

Comments
 (0)