John Drago > AWS-S3-0.031 > AWS::S3::FileIterator

Download:
AWS-S3-0.031.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: AWS-S3-0.051

NAME ^

AWS::S3::FileIterator - Easily access and iterate through your S3 files.

SYNOPSIS ^

  # Iterate through all ".txt" files, 100 at a time:
  my $iter = $bucket->files(
    # Required params:
    page_size   => 100,
    page_number => 1,
    # Optional params:
    pattern     => qr(\.txt$)
  );
  
  while( my @files = $iter->next_page )
  {
    warn $iter->page_number, "\n";
    foreach my $file ( @files )
    {
      print "\t", $file->key, "\n";
    }# end foreach()
  }# end while()

DESCRIPTION ^

AWS::S3::FileIterator provides a means of iterating through your S3 files.

If you only have a few files it might seem odd to require an iterator, but if you have thousands (or millions) of files, the iterator will save you a lot of effort.

PUBLIC PROPERTIES ^

has_prev

Boolean - read-only

has_next

Boolean - read-only

page_number

Integer - read-write

marker

String - read-only

Used internally to tell Amazon S3 where the last request for a listing of files left off.

pattern

Regexp - read-only

If supplied to the constructor, only files which match the pattern will be returned.

PUBLIC METHODS ^

next_page()

Returns the next page of results as an array in list context or arrayref in scalar context.

Increments page_number by one.

SEE ALSO ^

The Amazon S3 API Documentation

AWS::S3

AWS::S3::Bucket

AWS::S3::File

AWS::S3::Owner

Iterator::Paged - on which this class is built.

AUTHOR ^

John Drago <jdrago_999@yahoo.com>

LICENSE AND COPYRIGHT ^

This software is Free software and may be used and redistributed under the same terms as any version of perl itself.

Copyright John Drago 2011 all rights reserved.

syntax highlighting: