Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Data::Model::Iterator(User Contributed Perl DocumentatData::Model::Iterator(3)

NAME
       Data::Model::Iterator - Data::Model's iteration class

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! The	above document had some	coding errors, which are explained
       below:

       Around line 121:
	   Non-ASCII character seen before =encoding in	'<doet>'. Assuming
	   UTF-8

perl v5.32.0			  2013-07-08	      Data::Model::Iterator(3)

NAME | SYNOPSIS | METHODS | SEE ALSO | AUTHOR | LICENSE | POD ERRORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Data::Model::Iterator&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help