GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  IO::HANDLE::ITERATOR (3)

.ds Aq ’

NAME

IO::Handle::Iterator - Iterator based read handle

CONTENTS

SYNOPSIS



    IO::Handle::Iterator->new(sub {
        return $next_line; # or undef on eof
    });



DESCRIPTION

This class lets you define a read handle with a few fallback methods (like read) using a single callback that behaves like getline.

This is similar but much simpler than:



    IO::Handle::Prototype::Fallback->new(
        __read => sub { ... },
    );



The reason being that the IO::Handle::Prototype::Fallback implementation will try its very best to behave correctly (i.e. respect the value of $/), whereas this implementation assumes it’s fine to return things that aren’t exactly lines from getline, so the values are just passed through.

READ BUFFERING

When a method that requires buffering is invoked the handle is reblessed to a subclass which handles buffering.

Calling getline again on this object will return the value of the buffer and return to the normal iterator class.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 IO::HANDLE::ITERATOR (3) 2009-09-29

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.