Acme-CPANAuthors-Not
view release on metacpan or search on metacpan
lib/Acme/CPANAuthors/Not.pm view on Meta::CPAN
BEGIN {
$HOWMANY = "WHAT DO YOU GET IF YOU MULTIPLY SIX BY NINE?";
}
sub _freq_table {
my ($ids) = @_;
# Compute frequency tables for each letter in the CPAN id, to try
# to come up with vaguely sensible ids
my @lengths;
my @count; # ( offset into id => { letter => count } )
for my $id (@$ids) {
++$lengths[length($id)];
for my $i (0 .. length($id)) {
my $letter = substr($id, $i, 1);
$count[$i]{$letter}++;
}
}
my @freq; # ( offset into id => <letter,probability> )
for my $i (0 .. $#count) {
# Bump up minimums of letters to one, just to allow all
# possibilities.
$count[$i]{$_} ||= 1 foreach ('A' .. 'Z');
my $total = 0;
$total += $_ foreach (values %{ $count[$i] });
while (my ($letter, $count) = each %{ $count[$i] }) {
push @{ $freq[$i] }, [ $letter, $count / $total ];
lib/Acme/CPANAuthors/Not.pm view on Meta::CPAN
Acme::CPANAuthors::Not - We are not CPAN authors
=head1 DESCRIPTION
This class provides a hash of nonexistent CPAN authors' Pause ID/name to
Acme::CPANAuthors.
=head1 INTERNALS
While I was tempted to use a tied hash to provide an infinite set of
nonexistent authors, I decided against it because it wouldn't fit in
with Acme::CPANAuthors very well (it listifies the hash). So I went
for randomness instead.
Oh, and this module works way too hard for what it does.
=head1 MAINTENANCE
If you are a CPAN author and are listed here, there's a bug. Please
fix it.
use strict;
use warnings;
use Test::More;
eval "use Test::Pod 1.18";
plan skip_all => 'Test::Pod 1.18 required' if $@;
plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
all_pod_files_ok();
t/99_podcoverage.t view on Meta::CPAN
use strict;
use warnings;
use Test::More;
eval "use Test::Pod::Coverage 1.04";
plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
all_pod_coverage_ok();
( run in 0.531 second using v1.01-cache-2.11-cpan-49f99fa48dc )