++ed by:

2 non-PAUSE user(s).

Justin Davis


WWW::AUR::Iterator - An iterator for looping through all AUR packages.


  my $aurobj = WWW:AUR->new();
  my $iter = $aurobj->iter();
  # or without WWW::AUR:
  my $iter = WWW::AUR::Iterator->new();
  while ( my $pkg = $iter->next_obj ) {
      print $pkg->name, "\n";
  while ( my $p = $iter->next ) {
      print "$_:$p->{$_}\n"
          for qw{ id name version cat desc maint };
      print "---\n";
  # Retrieve information on the 12,345th package, alphabetically.
  my $pkginfo  = $iter->next;


A WWW::AUR::Iterator object can be used to iterate through all packages currently listed on the AUR webiste.


  $OBJ = WWW::AUR::Iterator->new( %PATH_PARAMS );

The parameters are the same as the WWW::AUR constructor. These are propogated to any WWW::AUR::Package objects that are created.


A WWW::AUR::Iterator object.




The iterator is reset to the beginning of all packages available in the AUR. This starts the iteration over just like creating a new WWW::AUR::Iterator object.


  \%PKGINFO | undef = $OBJ->next();

This package scrapes the http://aur.archlinux.org/packages.php webpage as if it kept clicking the Next button and recording each package.


A hash reference containing all the easily available information about that particular package. The follow table lists each key and its corresponding value.

  | NAME       | VALUE                                          |
  | name       | The name (pkgname) of the package.             |
  | votes      | The number of votes for the package.           |
  | desc       | The description (pkgdesc) of the package.      |
  | cat        | The AUR category name assigned to the package. |
  | maint      | The name of the maintainer of the package.     |

If we have iterated through all packages, then undef is returned.


  $PKGOBJ | undef = $OBJ->next_obj();

This package is like the "next" method above but creates a new object as a convenience. Keep in mind an HTTP request to AUR must be made when creating a new WWW::AUR::Package object. Use the "next" method if you can, it is faster.


A WWW::AUR::Package object representing the next package in the AUR.


If we have iterated through all packages, then undef is returned.


  undef = $OBJ->set_pos( $POS );

Set the iterator position to the given index in the entire list of packages from packages.php.


This is not the package ID but simply the list offset on the package webpage.




Justin Davis, <juster at cpan dot org>


Please email me any bugs you find. I will try to fix them as quick as I can.


Send me an email if you have any questions or need help.


Copyright 2014 Justin Davis.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

Hosting generously
sponsored by Bytemark