1BackPAN::Index::File(3)User Contributed Perl DocumentatioBnackPAN::Index::File(3)
2
3
4
6 BackPAN::Index::File - Represent a file on BackPAN
7
9 my $b = BackPAN::Index->new();
10 my $file = $b->file("authors/id/L/LB/LBROCARD/Acme-Colour-0.16.tar.gz");
11 print " Date: " . $file->date . "\n";
12 print " Path: " . $file->path . "\n";
13 print " Size: " . $file->size . "\n";
14 print " URL: " . $file->url . "\n";
15
17 BackPAN::Index::File objects represent files on BackPAN. It may
18 represent a release, a readme or meta file or just some random stuff on
19 BackPAN.
20
22 date
23 my $date = $file->date;
24
25 Returns the upload date of the file, in UNIX epoch seconds.
26
27 path
28 my $path = $file->path;
29
30 Returns the full path to the file on CPAN.
31
32 size
33 my $size = $file->size;
34
35 Returns the size of the file in bytes.
36
37 url
38 my $url = $file->url;
39
40 Returns a URL to the file on a BackPAN mirror.
41
42 filename
43 my $filename = $file->filename;
44
45 Returns the filename part of the path.
46
47 release
48 my $release = $file->release;
49
50 Returns the release associated with this file, if any, as a
51 BackPAN::Index::Release instance.
52
53 as_hash
54 my $data = $file->as_hash;
55
56 Returns a hash ref containing the data inside $file.
57
59 Leon Brocard <acme@astray.com>
60
62 Copyright (C) 2005-2009, Leon Brocard
63
64 This module is free software; you can redistribute it or modify it
65 under the same terms as Perl itself.
66
68 BackPAN::Index, BackPAN::Index::Release
69
70
71
72perl v5.30.0 2019-07-26 BackPAN::Index::File(3)