Acme-Throw

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN


                     END OF TERMS AND CONDITIONS

        Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

  To do so, attach the following notices to the program.  It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  <name of author>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 1, or (at your option)
    any later version.

t/lib/IO/String.pm  view on Meta::CPAN


 # seek
 $pos = $io->getpos;
 $io->setpos(0);        # rewind
 $io->seek(-30, -1);
 seek($io, 0, 0);

=head1 DESCRIPTION

The C<IO::String> module provides the C<IO::File> interface for in-core
strings.  An C<IO::String> object can be attached to a string, and
makes it possible to use the normal file operations for reading or
writing data, as well as for seeking to various locations of the string.
This is useful when you want to use a library module that only
provides an interface to file handles on data that you have in a string
variable.

Note that perl-5.8 and better has built-in support for "in memory"
files, which are set up by passing a reference instead of a filename
to the open() call. The reason for using this module is that it
makes the code backwards compatible with older versions of Perl.

t/lib/IO/String.pm  view on Meta::CPAN

=item $io->open

=item $io->open( $string )

Attaches an existing IO::String object to some other $string, or
allocates a new internal buffer (if no argument is given).  The
position is reset to 0.

=item $io->string_ref

Returns a reference to the string that is attached to
the C<IO::String> object.  Most useful when you let the C<IO::String>
create an internal buffer to write into.

=item $io->pad

=item $io->pad( $char )

Specifies the padding to use if
the string is extended by either the seek() or truncate() methods.  It
is a single character and defaults to "\0".



( run in 0.392 second using v1.01-cache-2.11-cpan-88abd93f124 )