NAME

BackPAN::Index::File - Represent a file on BackPAN

SYNOPSIS

my $b = BackPAN::Index->new();
my $file = $b->file("authors/id/L/LB/LBROCARD/Acme-Colour-0.16.tar.gz");
print "  Date: " . $file->date . "\n";
print "  Path: " . $file->path . "\n";
print "  Size: " . $file->size . "\n";
print "   URL: " . $file->url . "\n";

DESCRIPTION

BackPAN::Index::File objects represent files on BackPAN. It may represent a release, a readme or meta file or just some random stuff on BackPAN.

METHODS

date

my $date = $file->date;

Returns the upload date of the file, in UNIX epoch seconds.

path

my $path = $file->path;

Returns the full path to the file on CPAN.

size

my $size = $file->size;

Returns the size of the file in bytes.

url

my $url = $file->url;

Returns a URL to the file on a BackPAN mirror.

filename

my $filename = $file->filename;

Returns the filename part of the path.

release

my $release = $file->release;

Returns the release associated with this file, if any, as a BackPAN::Index::Release instance.

as_hash

my $data = $file->as_hash;

Returns a hash ref containing the data inside $file.

AUTHOR

Leon Brocard <acme@astray.com>

COPYRIGHT

Copyright (C) 2005-2009, Leon Brocard

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

SEE ALSO

BackPAN::Index, BackPAN::Index::Release