AWS::S3::FileIterator - Easily access and iterate through your S3 files.
# 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()
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.
Boolean - read-only
Integer - read-write
String - read-only
Used internally to tell Amazon S3 where the last request for a listing of files left off.
Regexp - read-only
If supplied to the constructor, only files which match the pattern will be returned.
Returns the next page of results as an array in list context or arrayref in scalar context.
Increments page_number by one.
page_number
The Amazon S3 API Documentation
AWS::S3
AWS::S3::Bucket
AWS::S3::File
AWS::S3::Owner
Iterator::Paged - on which this class is built.
To install AWS::S3, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AWS::S3
CPAN shell
perl -MCPAN -e shell install AWS::S3
For more information on module installation, please visit the detailed CPAN module installation guide.