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::ROUNDROBIN (3)

.ds Aq ’

NAME

Data::RoundRobin - Serve data in a round robin manner.

CONTENTS

SYNOPSIS



  my @array = qw(a b);
  # OO Interface
  my $rr = Data::RoundRobin->new(@array);

  print $rr->next; # a
  print $rr->next; # b
  print $rr->next; # a
  print $rr->next; # b
  ...

  # Infinite Loop
  while(my $elem = $rr->next) {
     ...
  }

  # Operator overloading
  my $rr = Data::RoundRobin->new(qw(a b));
  print $rr; # a
  print $rr; # b
  print $rr; # a



DESCRIPTION

This module provides a round roubin object implementation. It is similar to an iterator, only the internal counter is reset to the begining whenever it reaches the end. It might also be considered as a circular iterator.

METHODS

new Constructor, a list should be given to construct a Data::RoundRobin object.
next Retrieve next value of this instance.
numerify Retrieve next numerifed value of this instance. Invoked by Perl’s operator overloadding mechanism.

COPYRIGHT

Copyright 2006 by Kang-min Liu <gugod@gugod.org>

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

See <http://www.perl.com/perl/misc/Artistic.html>

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


perl v5.20.3 DATA::ROUNDROBIN (3) 2006-08-31

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