Add built local::lib
[catagits/Gitalist.git] / local-lib5 / man / man3 / Test::Builder::IO::Scalar.3pm
CommitLineData
3fea05b9 1.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "Test::Builder::IO::Scalar 3"
132.TH Test::Builder::IO::Scalar 3 "2009-09-02" "perl v5.8.7" "User Contributed Perl Documentation"
133.SH "NAME"
134Test::Builder::IO::Scalar \- A copy of IO::Scalar for Test::Builder
135.SH "DESCRIPTION"
136.IX Header "DESCRIPTION"
137This is a copy of IO::Scalar which ships with Test::Builder to
138support scalar references as filehandles on Perl 5.6. Newer
139versions of Perl simply use \f(CW\*(C`<open()\*(C'\fR>'s built in support.
140.PP
141Test::Builder can not have dependencies on other modules without
142careful consideration, so its simply been copied into the distribution.
143.SH "COPYRIGHT and LICENSE"
144.IX Header "COPYRIGHT and LICENSE"
145This file came from the \*(L"IO\-stringy\*(R" Perl5 toolkit.
146.PP
147Copyright (c) 1996 by Eryq. All rights reserved.
148Copyright (c) 1999,2001 by ZeeGee Software Inc. All rights reserved.
149.PP
150This program is free software; you can redistribute it and/or
151modify it under the same terms as Perl itself.
152.Sh "Construction"
153.IX Subsection "Construction"
154.IP "new [\s-1ARGS\s0...]" 4
155.IX Item "new [ARGS...]"
156\&\fIClass method.\fR
157Return a new, unattached scalar handle.
158If any arguments are given, they're sent to \fIopen()\fR.
159.IP "open [\s-1SCALARREF\s0]" 4
160.IX Item "open [SCALARREF]"
161\&\fIInstance method.\fR
162Open the scalar handle on a new scalar, pointed to by \s-1SCALARREF\s0.
163If no \s-1SCALARREF\s0 is given, a \*(L"private\*(R" scalar is created to hold
164the file data.
165.Sp
166Returns the self object on success, undefined on error.
167.IP "opened" 4
168.IX Item "opened"
169\&\fIInstance method.\fR
170Is the scalar handle opened on something?
171.IP "close" 4
172.IX Item "close"
173\&\fIInstance method.\fR
174Disassociate the scalar handle from its underlying scalar.
175Done automatically on destroy.
176.Sh "Input and output"
177.IX Subsection "Input and output"
178.IP "flush" 4
179.IX Item "flush"
180\&\fIInstance method.\fR
181No\-op, provided for \s-1OO\s0 compatibility.
182.IP "getc" 4
183.IX Item "getc"
184\&\fIInstance method.\fR
185Return the next character, or undef if none remain.
186.IP "getline" 4
187.IX Item "getline"
188\&\fIInstance method.\fR
189Return the next line, or undef on end of string.
190Can safely be called in an array context.
191Currently, lines are delimited by \*(L"\en\*(R".
192.IP "getlines" 4
193.IX Item "getlines"
194\&\fIInstance method.\fR
195Get all remaining lines.
196It will \fIcroak()\fR if accidentally called in a scalar context.
197.IP "print \s-1ARGS\s0..." 4
198.IX Item "print ARGS..."
199\&\fIInstance method.\fR
200Print \s-1ARGS\s0 to the underlying scalar.
201.Sp
202\&\fBWarning:\fR this continues to always cause a seek to the end
203of the string, but if you perform \fIseek()\fRs and \fItell()\fRs, it is
204still safer to explicitly seek-to-end before subsequent \fIprint()\fRs.
205.IP "read \s-1BUF\s0, \s-1NBYTES\s0, [\s-1OFFSET\s0]" 4
206.IX Item "read BUF, NBYTES, [OFFSET]"
207\&\fIInstance method.\fR
208Read some bytes from the scalar.
209Returns the number of bytes actually read, 0 on end\-of\-file, undef on error.
210.IP "write \s-1BUF\s0, \s-1NBYTES\s0, [\s-1OFFSET\s0]" 4
211.IX Item "write BUF, NBYTES, [OFFSET]"
212\&\fIInstance method.\fR
213Write some bytes to the scalar.
214.IP "sysread \s-1BUF\s0, \s-1LEN\s0, [\s-1OFFSET\s0]" 4
215.IX Item "sysread BUF, LEN, [OFFSET]"
216\&\fIInstance method.\fR
217Read some bytes from the scalar.
218Returns the number of bytes actually read, 0 on end\-of\-file, undef on error.
219.IP "syswrite \s-1BUF\s0, \s-1NBYTES\s0, [\s-1OFFSET\s0]" 4
220.IX Item "syswrite BUF, NBYTES, [OFFSET]"
221\&\fIInstance method.\fR
222Write some bytes to the scalar.
223.Sh "Seeking/telling and other attributes"
224.IX Subsection "Seeking/telling and other attributes"
225.IP "autoflush" 4
226.IX Item "autoflush"
227\&\fIInstance method.\fR
228No\-op, provided for \s-1OO\s0 compatibility.
229.IP "binmode" 4
230.IX Item "binmode"
231\&\fIInstance method.\fR
232No\-op, provided for \s-1OO\s0 compatibility.
233.IP "clearerr" 4
234.IX Item "clearerr"
235\&\fIInstance method.\fR Clear the error and \s-1EOF\s0 flags. A no\-op.
236.IP "eof" 4
237.IX Item "eof"
238\&\fIInstance method.\fR Are we at end of file?
239.IP "seek \s-1OFFSET\s0, \s-1WHENCE\s0" 4
240.IX Item "seek OFFSET, WHENCE"
241\&\fIInstance method.\fR Seek to a given position in the stream.
242.IP "sysseek \s-1OFFSET\s0, \s-1WHENCE\s0" 4
243.IX Item "sysseek OFFSET, WHENCE"
244\&\fIInstance method.\fR Identical to \f(CW\*(C`seek OFFSET, WHENCE\*(C'\fR, \fIq.v.\fR
245.IP "tell" 4
246.IX Item "tell"
247\&\fIInstance method.\fR
248Return the current position in the stream, as a numeric offset.
249.IP "use_RS [\s-1YESNO\s0]" 4
250.IX Item "use_RS [YESNO]"
251\&\fIInstance method.\fR
252\&\fBDeprecated and ignored.\fR
253Obey the curent setting of $/, like IO::Handle does?
254Default is false in 1.x, but cold-welded true in 2.x and later.
255.IP "setpos \s-1POS\s0" 4
256.IX Item "setpos POS"
257\&\fIInstance method.\fR
258Set the current position, using the opaque value returned by \f(CW\*(C`getpos()\*(C'\fR.
259.IP "getpos" 4
260.IX Item "getpos"
261\&\fIInstance method.\fR
262Return the current position in the string, as an opaque object.
263.IP "sref" 4
264.IX Item "sref"
265\&\fIInstance method.\fR
266Return a reference to the underlying scalar.
267.SH "WARNINGS"
268.IX Header "WARNINGS"
269Perl's \s-1TIEHANDLE\s0 spec was incomplete prior to 5.005_57;
270it was missing support for \f(CW\*(C`seek()\*(C'\fR, \f(CW\*(C`tell()\*(C'\fR, and \f(CW\*(C`eof()\*(C'\fR.
271Attempting to use these functions with an IO::Scalar will not work
272prior to 5.005_57. IO::Scalar will not have the relevant methods
273invoked; and even worse, this kind of bug can lie dormant for a while.
274If you turn warnings on (via \f(CW$^W\fR or \f(CW\*(C`perl \-w\*(C'\fR),
275and you see something like this...
276.PP
277.Vb 1
278\& attempt to seek on unopened filehandle
279.Ve
280.PP
281\&...then you are probably trying to use one of these functions
282on an IO::Scalar with an old Perl. The remedy is to simply
283use the \s-1OO\s0 version; e.g.:
284.PP
285.Vb 2
286\& $SH\->seek(0,0); ### GOOD: will work on any 5.005
287\& seek($SH,0,0); ### WARNING: will only work on 5.005_57 and beyond
288.Ve
289.SH "VERSION"
290.IX Header "VERSION"
291$Id: Scalar.pm,v 1.6 2005/02/10 21:21:53 dfs Exp $
292.SH "AUTHORS"
293.IX Header "AUTHORS"
294.Sh "Primary Maintainer"
295.IX Subsection "Primary Maintainer"
296David F. Skoll (\fIdfs@roaringpenguin.com\fR).
297.Sh "Principal author"
298.IX Subsection "Principal author"
299Eryq (\fIeryq@zeegee.com\fR).
300President, ZeeGee Software Inc (\fIhttp://www.zeegee.com\fR).
301.Sh "Other contributors"
302.IX Subsection "Other contributors"
303The full set of contributors always includes the folks mentioned
304in \*(L"\s-1CHANGE\s0 \s-1LOG\s0\*(R" in IO::Stringy. But just the same, special
305thanks to the following individuals for their invaluable contributions
306(if I've forgotten or misspelled your name, please email me!):
307.PP
308\&\fIAndy Glew,\fR
309for contributing \f(CW\*(C`getc()\*(C'\fR.
310.PP
311\&\fIBrandon Browning,\fR
312for suggesting \f(CW\*(C`opened()\*(C'\fR.
313.PP
314\&\fIDavid Richter,\fR
315for finding and fixing the bug in \f(CW\*(C`PRINTF()\*(C'\fR.
316.PP
317\&\fIEric L. Brine,\fR
318for his offset-using \fIread()\fR and \fIwrite()\fR implementations.
319.PP
320\&\fIRichard Jones,\fR
321for his patches to massively improve the performance of \f(CW\*(C`getline()\*(C'\fR
322and add \f(CW\*(C`sysread\*(C'\fR and \f(CW\*(C`syswrite\*(C'\fR.
323.PP
324\&\fIB. K. Oxley (binkley),\fR
325for stringification and inheritance improvements,
326and sundry good ideas.
327.PP
328\&\fIDoug Wilson,\fR
329for the IO::Handle inheritance and automatic tie\-ing.
330.SH "SEE ALSO"
331.IX Header "SEE ALSO"
332IO::String, which is quite similar but which was designed
333more-recently and with an IO::Handle\-like interface in mind,
334so you could mix \s-1OO\-\s0 and native-filehandle usage without using \fItied()\fR.
335.PP
336\&\fINote:\fR as of version 2.x, these classes all work like
337their IO::Handle counterparts, so we have comparable
338functionality to IO::String.