Result:
found more than 563 distributions - search limited to the first 2001 files matching your query ( run in 0.931 )


Acme-Beatnik

 view release on metacpan or  search on metacpan

test.pl  view on Meta::CPAN

boo UniSoft casts vistas rises doodle Pratt elite en minor Hegel
laser dent begs bee aborts pours Cray idea babbled gated nulls
Caribbean ocean Astor bottlers slider snail chasteness Auriga gnat soup erasers
sip Wellington realist Orion councilman nearest sang sue traps stare urinated
hull guns garland Paine Hettie souls Rickettsia adorns gnat nurses Gunnar
Wu lengthwise teared sorer canons kin Erato generalities Dugan alert Ithaca
unrolls sorer armload slurp dons bellhop Inman ager heater dildo Reese
Lin origin adorned loins emptily amino Estes cognac slops elite rollers
sensual Morrill Abe puppets attains Artie passiveness talents tub doubleton merit
sense Aprils saunter Somalis toast revises noble splines anion confuses oval
Mabel absorptive

 view all matches for this distribution


Acme-Blarghy-McBlarghBlargh

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN


    my $cwd = Cwd::cwd();

    $Config = [];

    my $maxlen = length(
        (
            sort   { length($b) <=> length($a) }
              grep { /^[^\-]/ }
              map  {
                ref($_)
                  ? ( ( ref($_) eq 'HASH' ) ? keys(%$_) : @{$_} )
                  : ''

 view all matches for this distribution


Acme-Bleach-Numerically

 view release on metacpan or  search on metacpan

lib/Acme/Bleach/Numerically.pm  view on Meta::CPAN

use Math::BigRat;

sub str2num{
    my $str = shift;
    return 0 if $str eq '';
    Math::BigFloat->accuracy(length($str) * 8); 
    my $bnum = Math::BigFloat->new(0);
    my $bden = Math::BigInt->new(256);
    $bden **= length($str);
    for my $ord (unpack "C*", $str){
	$bnum = $bnum * 256 + $ord;
    }    
    $bnum /= $bden;
    $bnum =~ s/0+$//o;

 view all matches for this distribution


Acme-Brainfuck

 view release on metacpan or  search on metacpan

lib/Acme/Brainfuck.pm  view on Meta::CPAN

{
    my $ret = $_;
    while ($ret =~ /\s ([\Q$ops\E]+) \s/gsx)
    {
	my $code = $1;
	my $len = length($1);
	my $at = pos($ret) - ($len + 1);

	$code =~ s/^/do { /g;
	$code =~ s/$/P; }; /g;
	$code =~ s/(\++)/"P += ".length($1).";" /eg;
	$code =~ s/(\-+)/"P -= ".length($1).";" /eg;
	$code =~ s/(<+)/"\$Acme::Brainfuck::p -= ".length($1).";" /eg; 
	$code =~ s/(>+)/"\$Acme::Brainfuck::p += ".length($1).";" /eg;
	$code =~ s/\./print chr P; /g;
	$code =~ s/,/P = ord getc;/g;
	$code =~ s/\[/while(P){/g;
	$code =~ s/\]/}; /g;
	if ($verbose)

 view all matches for this distribution


Acme-CPANAuthors-AnyEvent

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN


    my $cwd = Cwd::cwd();

    $Config = [];

    my $maxlen = length(
        (
            sort   { length($b) <=> length($a) }
              grep { /^[^\-]/ }
              map  {
                ref($_)
                  ? ( ( ref($_) eq 'HASH' ) ? keys(%$_) : @{$_} )
                  : ''

 view all matches for this distribution


Acme-CPANAuthors-Austrian

 view release on metacpan or  search on metacpan

t/000-report-versions.t  view on Meta::CPAN


    # Try to decode as utf8
    utf8::decode($string) if HAVE_UTF8;

    # Check for some special cases
    return $self unless length $string;
    unless ( $string =~ /[\012\015]+\z/ ) {
        return $self->_error("Stream does not end with newline character");
    }

    # Split the file into lines

t/000-report-versions.t  view on Meta::CPAN


        } elsif ( $lines[0] =~ /^(\s*)\S/ ) {
            # A hash at the root
            my $document = { };
            push @$self, $document;
            $self->_read_hash( $document, [ length($1) ], \@lines );

        } else {
            croak("YAML::Tiny failed to classify the line '$lines[0]'");
        }
    }

t/000-report-versions.t  view on Meta::CPAN

    if ( $string =~ /^\"((?:\\.|[^\"])*)\"\z/ ) {
        # Reusing the variable is a little ugly,
        # but avoids a new variable and a string copy.
        $string = $1;
        $string =~ s/\\"/"/g;
        $string =~ s/\\([never\\fartz]|x([0-9a-fA-F]{2}))/(length($1)>1)?pack("H2",$2):$UNESCAPES{$1}/gex;
        return $string;
    }

    # Special cases
    if ( $string =~ /^[\'\"!&]/ ) {

t/000-report-versions.t  view on Meta::CPAN

    # Error
    croak("YAML::Tiny failed to find multi-line scalar content") unless @$lines;

    # Check the indent depth
    $lines->[0]   =~ /^(\s*)/;
    $indent->[-1] = length("$1");
    if ( defined $indent->[-2] and $indent->[-1] <= $indent->[-2] ) {
        croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
    }

    # Pull the lines
    my @multiline = ();
    while ( @$lines ) {
        $lines->[0] =~ /^(\s*)/;
        last unless length($1) >= $indent->[-1];
        push @multiline, substr(shift(@$lines), length($1));
    }

    my $j = (substr($string, 0, 1) eq '>') ? ' ' : "\n";
    my $t = (substr($string, 1, 1) eq '-') ? ''  : "\n";
    return join( $j, @multiline ) . $t;

t/000-report-versions.t  view on Meta::CPAN

            return 1;
        }

        # Check the indent level
        $lines->[0] =~ /^(\s*)/;
        if ( length($1) < $indent->[-1] ) {
            return 1;
        } elsif ( length($1) > $indent->[-1] ) {
            croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
        }

        if ( $lines->[0] =~ /^(\s*\-\s+)[^\'\"]\S*\s*:(?:\s+|$)/ ) {
            # Inline nested hash
            my $indent2 = length("$1");
            $lines->[0] =~ s/-/ /;
            push @$array, { };
            $self->_read_hash( $array->[-1], [ @$indent, $indent2 ], $lines );

        } elsif ( $lines->[0] =~ /^\s*\-(\s*)(.+?)\s*\z/ ) {

t/000-report-versions.t  view on Meta::CPAN

            unless ( @$lines ) {
                push @$array, undef;
                return 1;
            }
            if ( $lines->[0] =~ /^(\s*)\-/ ) {
                my $indent2 = length("$1");
                if ( $indent->[-1] == $indent2 ) {
                    # Null array entry
                    push @$array, undef;
                } else {
                    # Naked indenter

t/000-report-versions.t  view on Meta::CPAN

                    $self->_read_array( $array->[-1], [ @$indent, $indent2 ], $lines );
                }

            } elsif ( $lines->[0] =~ /^(\s*)\S/ ) {
                push @$array, { };
                $self->_read_hash( $array->[-1], [ @$indent, length("$1") ], $lines );

            } else {
                croak("YAML::Tiny failed to classify line '$lines->[0]'");
            }

t/000-report-versions.t  view on Meta::CPAN

            return 1;
        }

        # Check the indent level
        $lines->[0] =~ /^(\s*)/;
        if ( length($1) < $indent->[-1] ) {
            return 1;
        } elsif ( length($1) > $indent->[-1] ) {
            croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
        }

        # Get the key
        unless ( $lines->[0] =~ s/^\s*([^\'\" ][^\n]*?)\s*:(\s+|$)// ) {

t/000-report-versions.t  view on Meta::CPAN

            croak("YAML::Tiny failed to classify line '$lines->[0]'");
        }
        my $key = $1;

        # Do we have a value?
        if ( length $lines->[0] ) {
            # Yes
            $hash->{$key} = $self->_read_scalar( shift(@$lines), [ @$indent, undef ], $lines );
        } else {
            # An indent
            shift @$lines;

t/000-report-versions.t  view on Meta::CPAN

                $hash->{$key} = undef;
                return 1;
            }
            if ( $lines->[0] =~ /^(\s*)-/ ) {
                $hash->{$key} = [];
                $self->_read_array( $hash->{$key}, [ @$indent, length($1) ], $lines );
            } elsif ( $lines->[0] =~ /^(\s*)./ ) {
                my $indent2 = length("$1");
                if ( $indent->[-1] >= $indent2 ) {
                    # Null hash entry
                    $hash->{$key} = undef;
                } else {
                    $hash->{$key} = {};
                    $self->_read_hash( $hash->{$key}, [ @$indent, length($1) ], $lines );
                }
            }
        }
    }

 view all matches for this distribution


Acme-CPANAuthors-BackPAN-OneHundred

 view release on metacpan or  search on metacpan

examples/update100.pl  view on Meta::CPAN

        $changed = 1;
    } else {
        delete $pause{$pause};
    }

    $max = length $new{$inx}{pause} if($max < length $new{$inx}{pause});
}
$fh->close;

$tvars{COUNT} = scalar(keys %new);
#print "new=" . Dumper(\%new);

examples/update100.pl  view on Meta::CPAN

$max = (int($max/4) + 1) * 4    if($max % 4);
$max+=2;

# create lists
for my $inx (sort {$new{$a}{pause} cmp $new{$b}{pause}} keys %new) {
    my $pad = $max - length $new{$inx}{pause};
    push @{$tvars{LIST1}}, sprintf "    '%s'%s=> '%s',", $new{$inx}{pause}, (' ' x $pad), $new{$inx}{name};
}

my $cnt = 1;
for my $inx (sort {$new{$b}{count} <=> $new{$a}{count} || $new{$a}{pause} cmp $new{$b}{pause}} keys %new) {
    my $pad = $max - length $new{$inx}{pause};
    push @{$tvars{LIST2}}, sprintf "  %2d.  %3d  %s%s%s", $cnt++, $new{$inx}{count}, $new{$inx}{pause}, (' ' x $pad), $new{$inx}{name};
}

# calculate copyright
$tvars{COPYRIGHT} = '2014';

 view all matches for this distribution


Acme-CPANAuthors-British

 view release on metacpan or  search on metacpan

t/10british.t  view on Meta::CPAN


    @distros = $authors->distributions('XXXXXX');
    cmp_ok( ~~@distros, "==", 0, " .. \$authors->distributions('XXXXXX') gives an empty list" );

    my $name = $authors->name('DGL');
    cmp_ok( length($name), ">", 0, " .. \$authors->name('DGL') gives a non-empty string" );
    $name = $authors->name('BARBIE');
    is($name, "Barbie", " .. \$authors->name('BARBIE') returns Barbie" );

#    SKIP: {
#        skip "en.gravatar.com is not available", 2

t/10british.t  view on Meta::CPAN

#        is($url, 'http://www.gravatar.com/avatar/2459f554c069e44527716e3f35e1d0d1', ".. \$authors->avatar_url('BARBIE') returns a URL" );
#
#        eval { $url = $authors->avatar_url('BINGOS') };
#        skip "en.gravatar.com is not available", 1 if($@);
#        $url ||= '';
#        cmp_ok( length($url), ">", 0, " .. \$authors->avatar_url('BINGOS') gives a non-empty string" );
#    }

    SKIP: {
        skip "api.cpanauthors.org is not available", 1
            if(pingtest('api.cpanauthors.org'));

 view all matches for this distribution


Acme-CPANAuthors-CPAN-OneHundred

 view release on metacpan or  search on metacpan

examples/update100.pl  view on Meta::CPAN

        $changed = 1;
    } else {
        delete $pause{$pause};
    }

    $max = length $new{$inx}{pause} if($max < length $new{$inx}{pause});
}
$fh->close;

$tvars{COUNT} = scalar(keys %new);
#print "new=" . Dumper(\%new);

examples/update100.pl  view on Meta::CPAN

$max = (int($max/4) + 1) * 4    if($max % 4);
$max+=2;

# create lists
for my $inx (sort {$new{$a}{pause} cmp $new{$b}{pause}} keys %new) {
    my $pad = $max - length $new{$inx}{pause};
    push @{$tvars{LIST1}}, sprintf "    '%s'%s=> '%s',", $new{$inx}{pause}, (' ' x $pad), $new{$inx}{name};
}

my $cnt = 1;
for my $inx (sort {$new{$b}{count} <=> $new{$a}{count} || $new{$a}{pause} cmp $new{$b}{pause}} keys %new) {
    my $pad = $max - length $new{$inx}{pause};
    push @{$tvars{LIST2}}, sprintf "  %2d.  %3d  %s%s%s", $cnt++, $new{$inx}{count}, $new{$inx}{pause}, (' ' x $pad), $new{$inx}{name};
}

# calculate copyright
$tvars{COPYRIGHT} = '2014';

 view all matches for this distribution


Acme-CPANAuthors-Canadian

 view release on metacpan or  search on metacpan

t/00-report-prereqs.t  view on Meta::CPAN

        }

        if ( @reports ) {
            push @full_reports, "=== $title ===\n\n";

            my $ml = _max( map { length $_->[0] } @reports );
            my $wl = _max( map { length $_->[1] } @reports );
            my $hl = _max( map { length $_->[2] } @reports );

            if ($type eq 'modules') {
                splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
                push @full_reports, map { sprintf("    %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
            }

 view all matches for this distribution


Acme-CPANAuthors-Czech

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		$s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg;
	}
	$s =~ s/^(\d+)\.?//;
	my $l = $1 || 0;
	my @v = map {
		$_ . '0' x (3 - length $_)
	} $s =~ /(\d{1,3})\D?/g;
	$l = $l . '.' . join '', @v if @v;
	return $l + 0;
}

 view all matches for this distribution


Acme-CPANAuthors-French

 view release on metacpan or  search on metacpan

t/10-synopsis.t  view on Meta::CPAN


    my @distros  = $authors->distributions("SAPER");
    cmp_ok( ~~@distros, ">", 0, " .. \$authors->distributions gives a non-empty list" );

    my $url      = $authors->avatar_url("VPIT");
    cmp_ok( length($url), ">", 0, " .. \$authors->avatar_url('VPIT') gives a non-empty string" );

    my $kwalitee = eval { $authors->kwalitee("BOOK") };
    SKIP: {
        skip $@, 1 if $@ =~ /Can't connect to cpants.perl.org/;
        isa_ok( $kwalitee, "HASH", " .. \$authors->kwalitee('BOOK')" );
    }

    my $name     = $authors->name("RGARCIA");
    cmp_ok( length($name), ">", 0, " .. \$authors->name('RGARCIA') gives a non-empty string" );
}

 view all matches for this distribution


Acme-CPANAuthors-GeekHouse

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN


sub _version ($) {
	my $s = shift || 0;
	   $s =~ s/^(\d+)\.?//;
	my $l = $1 || 0;
	my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g;
	   $l = $l . '.' . join '', @v if @v;
	return $l + 0;
}

# Cloned from Params::Util::_CLASS

 view all matches for this distribution


Acme-CPANAuthors-InMemoriam

 view release on metacpan or  search on metacpan

t/10inmemoriam.t  view on Meta::CPAN

#        is($url, 'http://www.gravatar.com/avatar/2459f554c069e44527716e3f35e1d0d1', ".. \$authors->avatar_url('IVORW') returns a URL" );
#
#        eval { $url = $authors->avatar_url('BARBIE') };
#        skip "en.gravatar.com is not available", 1 if($@);
#        $url ||= '';
#        cmp_ok( length($url), ">", 0, " .. \$authors->avatar_url('BINGOS') gives a non-empty string" );
#    }

    SKIP: {
        skip "api.cpanauthors.org is not available", 1
            if(pingtest('api.cpanauthors.org'));

 view all matches for this distribution


Acme-CPANAuthors-India

 view release on metacpan or  search on metacpan

t/00-report-prereqs.t  view on Meta::CPAN

        push @reports, [ "missing", $mod ];
    }
}

if (@reports) {
    my $vl = max map { length $_->[0] } @reports;
    my $ml = max map { length $_->[1] } @reports;
    splice @reports, 1, 0, [ "-" x $vl, "-" x $ml ];
    diag "Prerequisite Report:\n",
      map { sprintf( "  %*s %*s\n", $vl, $_->[0], -$ml, $_->[1] ) } @reports;
}

 view all matches for this distribution


Acme-CPANAuthors-MBTI

 view release on metacpan or  search on metacpan

t/00-report-prereqs.t  view on Meta::CPAN

        }

        if ( @reports ) {
            push @full_reports, "=== $title ===\n\n";

            my $ml = _max( map { length $_->[0] } @reports );
            my $wl = _max( map { length $_->[1] } @reports );
            my $hl = _max( map { length $_->[2] } @reports );

            if ($type eq 'modules') {
                splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
                push @full_reports, map { sprintf("    %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
            }

 view all matches for this distribution


Acme-CPANAuthors-Malaysian

 view release on metacpan or  search on metacpan

t/000-report-versions.t  view on Meta::CPAN


    # Try to decode as utf8
    utf8::decode($string) if HAVE_UTF8;

    # Check for some special cases
    return $self unless length $string;
    unless ( $string =~ /[\012\015]+\z/ ) {
        return $self->_error("Stream does not end with newline character");
    }

    # Split the file into lines

t/000-report-versions.t  view on Meta::CPAN


        } elsif ( $lines[0] =~ /^(\s*)\S/ ) {
            # A hash at the root
            my $document = { };
            push @$self, $document;
            $self->_read_hash( $document, [ length($1) ], \@lines );

        } else {
            croak("YAML::Tiny failed to classify the line '$lines[0]'");
        }
    }

t/000-report-versions.t  view on Meta::CPAN

    if ( $string =~ /^\"((?:\\.|[^\"])*)\"\z/ ) {
        # Reusing the variable is a little ugly,
        # but avoids a new variable and a string copy.
        $string = $1;
        $string =~ s/\\"/"/g;
        $string =~ s/\\([never\\fartz]|x([0-9a-fA-F]{2}))/(length($1)>1)?pack("H2",$2):$UNESCAPES{$1}/gex;
        return $string;
    }

    # Special cases
    if ( $string =~ /^[\'\"!&]/ ) {

t/000-report-versions.t  view on Meta::CPAN

    # Error
    croak("YAML::Tiny failed to find multi-line scalar content") unless @$lines;

    # Check the indent depth
    $lines->[0]   =~ /^(\s*)/;
    $indent->[-1] = length("$1");
    if ( defined $indent->[-2] and $indent->[-1] <= $indent->[-2] ) {
        croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
    }

    # Pull the lines
    my @multiline = ();
    while ( @$lines ) {
        $lines->[0] =~ /^(\s*)/;
        last unless length($1) >= $indent->[-1];
        push @multiline, substr(shift(@$lines), length($1));
    }

    my $j = (substr($string, 0, 1) eq '>') ? ' ' : "\n";
    my $t = (substr($string, 1, 1) eq '-') ? ''  : "\n";
    return join( $j, @multiline ) . $t;

t/000-report-versions.t  view on Meta::CPAN

            return 1;
        }

        # Check the indent level
        $lines->[0] =~ /^(\s*)/;
        if ( length($1) < $indent->[-1] ) {
            return 1;
        } elsif ( length($1) > $indent->[-1] ) {
            croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
        }

        if ( $lines->[0] =~ /^(\s*\-\s+)[^\'\"]\S*\s*:(?:\s+|$)/ ) {
            # Inline nested hash
            my $indent2 = length("$1");
            $lines->[0] =~ s/-/ /;
            push @$array, { };
            $self->_read_hash( $array->[-1], [ @$indent, $indent2 ], $lines );

        } elsif ( $lines->[0] =~ /^\s*\-(\s*)(.+?)\s*\z/ ) {

t/000-report-versions.t  view on Meta::CPAN

            unless ( @$lines ) {
                push @$array, undef;
                return 1;
            }
            if ( $lines->[0] =~ /^(\s*)\-/ ) {
                my $indent2 = length("$1");
                if ( $indent->[-1] == $indent2 ) {
                    # Null array entry
                    push @$array, undef;
                } else {
                    # Naked indenter

t/000-report-versions.t  view on Meta::CPAN

                    $self->_read_array( $array->[-1], [ @$indent, $indent2 ], $lines );
                }

            } elsif ( $lines->[0] =~ /^(\s*)\S/ ) {
                push @$array, { };
                $self->_read_hash( $array->[-1], [ @$indent, length("$1") ], $lines );

            } else {
                croak("YAML::Tiny failed to classify line '$lines->[0]'");
            }

t/000-report-versions.t  view on Meta::CPAN

            return 1;
        }

        # Check the indent level
        $lines->[0] =~ /^(\s*)/;
        if ( length($1) < $indent->[-1] ) {
            return 1;
        } elsif ( length($1) > $indent->[-1] ) {
            croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
        }

        # Get the key
        unless ( $lines->[0] =~ s/^\s*([^\'\" ][^\n]*?)\s*:(\s+|$)// ) {

t/000-report-versions.t  view on Meta::CPAN

            croak("YAML::Tiny failed to classify line '$lines->[0]'");
        }
        my $key = $1;

        # Do we have a value?
        if ( length $lines->[0] ) {
            # Yes
            $hash->{$key} = $self->_read_scalar( shift(@$lines), [ @$indent, undef ], $lines );
        } else {
            # An indent
            shift @$lines;

t/000-report-versions.t  view on Meta::CPAN

                $hash->{$key} = undef;
                return 1;
            }
            if ( $lines->[0] =~ /^(\s*)-/ ) {
                $hash->{$key} = [];
                $self->_read_array( $hash->{$key}, [ @$indent, length($1) ], $lines );
            } elsif ( $lines->[0] =~ /^(\s*)./ ) {
                my $indent2 = length("$1");
                if ( $indent->[-1] >= $indent2 ) {
                    # Null hash entry
                    $hash->{$key} = undef;
                } else {
                    $hash->{$key} = {};
                    $self->_read_hash( $hash->{$key}, [ @$indent, length($1) ], $lines );
                }
            }
        }
    }

 view all matches for this distribution


Acme-CPANAuthors-Misanthrope

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN


    my $cwd = Cwd::cwd();

    $Config = [];

    my $maxlen = length(
        (
            sort   { length($b) <=> length($a) }
              grep { /^[^\-]/ }
              map  {
                ref($_)
                  ? ( ( ref($_) eq 'HASH' ) ? keys(%$_) : @{$_} )
                  : ''

 view all matches for this distribution


Acme-CPANAuthors-Nonhuman

 view release on metacpan or  search on metacpan

t/00-report-prereqs.t  view on Meta::CPAN

        }

        if ( @reports ) {
            push @full_reports, "=== $title ===\n\n";

            my $ml = _max( map { length $_->[0] } @reports );
            my $wl = _max( map { length $_->[1] } @reports );
            my $hl = _max( map { length $_->[2] } @reports );

            if ($type eq 'modules') {
                splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
                push @full_reports, map { sprintf("    %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
            }

 view all matches for this distribution


Acme-CPANAuthors-Not

 view release on metacpan or  search on metacpan

lib/Acme/CPANAuthors/Not.pm  view on Meta::CPAN

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}++;
        }
    }

lib/Acme/CPANAuthors/Not.pm  view on Meta::CPAN

        while (my ($letter, $count) = each %{ $count[$i] }) {
            push @{ $freq[$i] }, [ $letter, $count / $total ];
        }
    }

    my $length_total = 0;
    $_ ||= 0 foreach (@lengths);
    $length_total += $_ foreach (@lengths);
    $_ /= $length_total foreach (@lengths);

    return (\@lengths, \@freq);
}

sub _random_id {
    my ($lengths, $freq) = @_;

    my $lrand = rand();
    my $length = -1;
    while ($lrand > 0 && $length <= @$lengths) {
        $lrand -= $lengths->[++$length];
    }

    my $id;
    for (1 .. $length) {
        my $r = rand();
        my $lastr = $r;
        my @pick = @{ $freq->[$_] };
        while ($r > 0 && @pick > 1) {
            $r -= shift(@pick)->[1];

lib/Acme/CPANAuthors/Not.pm  view on Meta::CPAN

    }
    $howmany = eval $howmany;

    # Compute frequency tables for each letter in the CPAN id, to try
    # to come up with vaguely sensible ids
    my ($length_freq, $letter_freq) = _freq_table([ keys %ids ]);

    # Generate $howmany random ids
    my @invalid_ids;
    while (@invalid_ids < $howmany) {
        my $id = _random_id($length_freq, $letter_freq);
        push @invalid_ids, $id unless exists $ids{$id};
    }

    # Pick a name for each author
    my $name_table = _name_table([ map { $_->name } $authors->authors ]);

 view all matches for this distribution


Acme-CPANAuthors-Slovak

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		$s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg;
	}
	$s =~ s/^(\d+)\.?//;
	my $l = $1 || 0;
	my @v = map {
		$_ . '0' x (3 - length $_)
	} $s =~ /(\d{1,3})\D?/g;
	$l = $l . '.' . join '', @v if @v;
	return $l + 0;
}

 view all matches for this distribution


Acme-CPANAuthors-Turkish

 view release on metacpan or  search on metacpan

t/00-report-prereqs.t  view on Meta::CPAN

        }

        if ( @reports ) {
            push @full_reports, "=== $title ===\n\n";

            my $ml = _max( map { length $_->[0] } @reports );
            my $wl = _max( map { length $_->[1] } @reports );
            my $hl = _max( map { length $_->[2] } @reports );

            if ($type eq 'modules') {
                splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
                push @full_reports, map { sprintf("    %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
            }

 view all matches for this distribution


Acme-CPANAuthorsBundle-CPAN-Streaks

 view release on metacpan or  search on metacpan

lib/Acme/CPANAuthors/CPAN/Streaks/DailyDistributions/AllTime.pm  view on Meta::CPAN


=head1 SYNOPSIS

=head1 DESCRIPTION

Current standings (as of 2024-06-12, produced by L<cpan-streaks>, only streaks with length of at least 6 are included):

  +-----------+-----+------------+------------+--------+
  | author    | len | start_date | end_date   | status |
  +-----------+-----+------------+------------+--------+
  | PERLANCAR |  56 | 2024-04-16 | 2024-06-10 | broken |

 view all matches for this distribution


Acme-CPANLists-PERLANCAR

 view release on metacpan or  search on metacpan

lib/Acme/CPANLists/PERLANCAR/Task/PickingRandomLinesFromFile.pm  view on Meta::CPAN

preferred for very large files.

Note that due to the nature of the algorithm, lines are weighted by the number
of characters. In other words, lines that have long lines immediately preceding
them will have a greater probability of being picked. Depending on your use case
or the line length variation of your file, this algorithm might or might not be
acceptable to you.

_
            },
            {

lib/Acme/CPANLists/PERLANCAR/Task/PickingRandomLinesFromFile.pm  view on Meta::CPAN

preferred for very large files.

Note that due to the nature of the algorithm, lines are weighted by the number
of characters. In other words, lines that have long lines immediately preceding
them will have a greater probability of being picked. Depending on your use case
or the line length variation of your file, this algorithm might or might not be
acceptable to you.


=item * L<File::Random::Pick>

 view all matches for this distribution


Acme-CPANModules-CLI-Sort

 view release on metacpan or  search on metacpan

lib/Acme/CPANModules/CLI/Sort.pm  view on Meta::CPAN

            summary => 'Sort lines of text using cmp operator or custom Perl code',
            module => 'App::psort',
            script => 'psort',
        },
        {
            summary => 'Sort lines of text by their length',
            module => 'App::lensort',
            script => 'lensort',
        },
    ],
};

lib/Acme/CPANModules/CLI/Sort.pm  view on Meta::CPAN


Author: L<SREZIC|https://metacpan.org/author/SREZIC>

Script: L<psort>

=item * L<App::lensort> - Sort lines of text by their length

Author: L<PERLANCAR|https://metacpan.org/author/PERLANCAR>

Script: L<lensort>

 view all matches for this distribution


Acme-CPANModules-PickingRandomLinesFromFile

 view release on metacpan or  search on metacpan

lib/Acme/CPANModules/PickingRandomLinesFromFile.pm  view on Meta::CPAN

preferred for very large files.

Note that due to the nature of the algorithm, lines are weighted by the number
of characters. In other words, lines that have long lines immediately preceding
them will have a greater probability of being picked. Depending on your use case
or the line length variation of your file, this algorithm might or might not be
acceptable to you.

_
        },
        {

lib/Acme/CPANModules/PickingRandomLinesFromFile.pm  view on Meta::CPAN

preferred for very large files.

Note that due to the nature of the algorithm, lines are weighted by the number
of characters. In other words, lines that have long lines immediately preceding
them will have a greater probability of being picked. Depending on your use case
or the line length variation of your file, this algorithm might or might not be
acceptable to you.


=item L<File::Random::Pick>

 view all matches for this distribution


Acme-CPANModules-StructuredDATA

 view release on metacpan or  search on metacpan

lib/Acme/CPANModules/StructuredDATA.pm  view on Meta::CPAN

    This is part1
    This is part
    two

The first paragraph after __DATA__ is called the TOC which lists all the parts
along with their offsets and lengths. It is therefore possible to locate any
part just from reading the TOC instead of scanning for headers on the whole
data. It is useful when the amount of data is quite large and you need quick
access to random parts.

_

lib/Acme/CPANModules/StructuredDATA.pm  view on Meta::CPAN

 This is part1
 This is part
 two

The first paragraph after B<DATA> is called the TOC which lists all the parts
along with their offsets and lengths. It is therefore possible to locate any
part just from reading the TOC instead of scanning for headers on the whole
data. It is useful when the amount of data is quite large and you need quick
access to random parts.


 view all matches for this distribution


Acme-CPANModules-TextTable

 view release on metacpan or  search on metacpan

lib/Acme/CPANModules/TextTable.pm  view on Meta::CPAN

 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="file:///home/u1/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/auto/share/dist/Text-Table-HTML-DataTables/datatables-1.10.22/datatables.css">
 <script src="file:///home/u1/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/auto/share/dist/Text-Table-HTML-DataTables/jquery-2.2.4/jquery-2.2.4.min.js"></script>
 <script src="file:///home/u1/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/auto/share/dist/Text-Table-HTML-DataTables/datatables-1.10.22/datatables.js"></script>
 <script>var dt_opts = {"buttons":["colvis","print"],"dom":"lQfrtip"}; $(document).ready(function() { $("table").DataTable(dt_opts); $("select[name=DataTables_Table_0_length]").val(1000); $("select[name=DataTables_Table_0_length]").trigger("change");...
 
 </head>
 
 <body>
 <table>

 view all matches for this distribution


Acme-CPANModules-fgets

 view release on metacpan or  search on metacpan

lib/Acme/CPANModules/fgets.pm  view on Meta::CPAN

our $LIST = {
    summary => "List of fgets() implementations in Perl",
    description => <<'_',

Reading a line of data from a filehandle in Perl is easy, but Perl will happily
slurp line of any length without limit, even gigabytes which can cause your
script or system to run out of memory.

`fgets()` is a standard I/O C function to get a line of data with a length
limit. In many cases you don't need in this Perl but in some cases you do. The
lack of built-in `fgets()` function in Perl (unlike in, say, PHP) is a bit
annoying, but no worries because there are several CPAN modules that provide you
with just that.

lib/Acme/CPANModules/fgets.pm  view on Meta::CPAN

This document describes version 0.003 of Acme::CPANModules::fgets (from Perl distribution Acme-CPANModules-fgets), released on 2022-03-18.

=head1 DESCRIPTION

Reading a line of data from a filehandle in Perl is easy, but Perl will happily
slurp line of any length without limit, even gigabytes which can cause your
script or system to run out of memory.

C<fgets()> is a standard I/O C function to get a line of data with a length
limit. In many cases you don't need in this Perl but in some cases you do. The
lack of built-in C<fgets()> function in Perl (unlike in, say, PHP) is a bit
annoying, but no worries because there are several CPAN modules that provide you
with just that.

lib/Acme/CPANModules/fgets.pm  view on Meta::CPAN


XS module. Seems to have trouble dealing with piped command. But works well in
low-throughput situation as well as in non-blocking mode.


=item * L<File::GetLineMaxLength> - Get lines from a file, up to a maximum line length

Author: L<ROBM|https://metacpan.org/author/ROBM>

Pure-Perl module. Different interface (use an OO wrapper) so a bit more
cumbersome to use. Uses a fixed 4096-byte block size so doesn't work well in

 view all matches for this distribution


Acme-CPANModulesBundle-Import-MojoliciousAdvent-2017

 view release on metacpan or  search on metacpan

devdata/https_mojolicious.io_blog_2017_12_11_day-11-useragent-content-generators  view on Meta::CPAN



</code></pre>

<p>Though you have to form the parts a little more manually (no, generators don&#39;t call other generators), this is still a much simpler use than building the message manually.
Most notably, the length calculations and all of the boundary handling is done transparently.</p>

<h2>Adding New Content Generators</h2>

<p>So if you are reading this and thinking that Content Generators look great but the type you need isn&#39;t available, take heart!
Adding content generators is easy too!

 view all matches for this distribution


( run in 0.931 second using v1.01-cache-2.11-cpan-65fba6d93b7 )