Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

koschei (147)

koschei
  useperl@dellah.org
http://eh.org/~koschei/

Um. Me. Iain Truskett. Can be found as either Spoon or Koschei around the place, and as Braxiatel in rare circumstances. Um. Cool. Ta.

My perl svn repository [dellah.org] if you want bits of code by me. Also see dellah.org [dellah.org] for most of them in action.

My friends [perl.org], foes [perl.org], fans [perl.org], and freaks [perl.org]. And you can see what my friends are journalling [perl.org].

And everybody's journals [perl.org] (in order of updating).

Journal of koschei (147)

Sunday March 09, 2003
08:35 AM

Authors from packages

[ #10961 ]

No, it doesn't handle every file extension. Nor every package. Nor does it take parameters. Yes, you have to modify the source to make it do anything useful for you . No, I'm not particularly concerned. Just thought someone might be amused by it =)

For something more useful: DateTime::Format::Excel (docs).

#!/usr/bin/perl -w
use strict;
use YAML;
use PerlIO::gzip;

my $packages = do {
    my %packages;
    open my $pkgs_fh, '<:gzip',
        'minicpan/modules/02packages.details.txt.gz'
        or die "Cannot open pkgs: $!\n";
    while (<$pkgs_fh>)
    {
        $packages{$2} = $1 if m[ ^ \S+ \s+ \S+ \s+
             [A-Z]/[A-Z][A-Z]/([A-Z]+)/(\S+)(?:\.(?:tar\.gz|zip))
        $ ]x;
    }
    close $pkgs_fh;
    \%packages;
};

print "Read the details of ".(keys %$packages)." packages.\n";

my %authors;

while (<DATA>)
{
    chomp;
    printf "%30.30s => %s\n", $_, $packages->{$_};
    push @{ $authors{ $packages->{$_} } } , $_;
}

print Dump(\%authors);

__DATA__
Acme-Hello-0.02
Apache-Filter-1.022
B-Generate-1 .06
Class-Container-0.10
Crypt-SKey-0.06
HTML-SimpleParse-0.11
Module-Build- 0.16
Test-Signature-1.03
Text-WikiFormat-0.6
Thesaurus-0.21
WWW-SherlockSear ch-0.14
WWW-Shorten-1.5.6
WWW-Yahoo-Groups-1.7.7
XML-RSS-Aggregate-0.02
opti mize-0.03
types-0.05

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.