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  -  DATA::MODEL::ITERATOR (3)

.ds Aq ’

NAME

Data::Model::Iterator - Data::Model’s iteration class

CONTENTS

SYNOPSIS



  use Data::Model::Iterator;

  my @stack = qw( 1 2 );
  my $itr = Data::Model::Iterator->new(
      sub { ok(1, do shift); shift @stack },
      end   => sub { ok(1, do end) },
      reset => sub { ok(1, do reset) },
  );

  #
  Dump($itr->next) if $itr->has_next;

  # iteration
  while (my $row = $itr->next) {
      say $row;
      # some code
  }

  while (<$itr>) {
      say $_;
      # some code
  }

  while (my $row = <$itr>) {
      say $row;
      # some code
  }



for empty iteration



  my $itr = Data::Model::Iterator::Empty->new;
  return unless $itr; # bool overload
  return unless $itr->has_next;



METHODS

    has_next

    next

    reset

SEE ALSO

overload

AUTHOR

Kazuhiro Osawa <yappo <at> shibuya <doet> pl>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 121: Non-ASCII character seen before =encoding in ’<doet>’. Assuming UTF-8
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DATA::MODEL::ITERATOR (3) 2013-07-08

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