view release on metacpan or search on metacpan
lib/Math/ReedSolomon/Encoder.pm view on Meta::CPAN
my ($quot, $rem) = _gf256_poly_div([$msg->@*, (0) x $nsym ], $g);
return $rem;
}
sub rs_correction_string ($msg, $nsym) {
my $aref = [ map { ord($_) } split m{}mxs, $msg ];
return join '', map { chr($_) } rs_correction($aref, $nsym)->@*;
}
sub rs_encode ($msg, $nsym) {
return [ $msg->@*, rs_correction($msg, $nsym)->@* ];
view all matches for this distribution
view release on metacpan or search on metacpan
PhysicalValue.pm view on Meta::CPAN
# on kg*m/s vs m*kg/s
# (this will only catch simple cases)
my @to_fix;
while($u =~ m/\b(\w+\*\w+)\b/g) {
my $orig = $1;
my @s = split m/\*/, $orig;
my $fixed = join('*', sort @s);
push @to_fix, [quotemeta($orig) => $fixed] if $orig ne $fixed;
}
$u =~ s/$_->[0]/$_->[1]/ for @to_fix;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MediaWiki/Bot/Plugin/Admin.pm view on Meta::CPAN
sub delete_archived_image {
my $self = shift;
my $archive = shift;
my $summary = shift || 'BOT: deleting old version of image by command';
my $file = [ split m/!/, $archive ]->[1];
my ($token) = $self->_get_edittoken($file);
my $res = $self->{api}->api({
action => 'delete',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Melian.pm view on Meta::CPAN
# table1#0|60|id#0:int,table2#1|45|id#0:int;hostname#1:string
sub load_schema_from_spec {
my $spec = shift;
my %data;
for my $section_data ( split m{,}, $spec ) {
my ( $table_data, $table_period, $columns ) = split m{\|}, $section_data;
my ( $table_name, $table_id ) = split m{#}, $table_data;
defined $table_name && defined $table_id
or croak('Schema spec failure: Missing table name or table ID');
my %table_entry = (
'name' => $table_name,
'id' => $table_id,
'period' => $table_period,
);
my @columns;
foreach my $column_data ( split m{;}, $columns ) {
my ( $column_data, $column_type ) = split /:/, $column_data;
my ( $column_name, $column_id ) = split m{#}, $column_data;
push @{ $table_entry{'indexes'} }, {
'id' => $column_id,
'column' => $column_name,
'type' => $column_type,
view all matches for this distribution
view release on metacpan or search on metacpan
# Get report.
sub report {
my $self = shift;
my $report = $self->SUPER::report;
my @report_full = split m/\n/ms, $report;
my @report = ();
if (@report_full > 2) {
@report = ($report_full[0], $report_full[-2], $report_full[-1]);
};
my $report_scalar = (join "\n", @report);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mercury/Controller/PubSub/Cascade.pm view on Meta::CPAN
# the "Cascade" part.
#=cut
sub _send_message {
my ( $c, $topic, $msg ) = @_;
my @parts = split m{/}, $topic;
my @patterns =
# Only pattern objects that have been created
grep { defined }
# Change topics into pattern objects
map { $c->mercury->pattern( 'PubSub::Cascade' => $_ ) }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Message/String.pm view on Meta::CPAN
$export_ok = 1;
undef $export;
}
elsif ( substr( $this_arg, 0, 1 ) eq ':' ) {
( my $tag = substr( $this_arg, 1 ) ) =~ s/(?:^\s+|\s+$)//;
my @new_tags = split m{\s*[,]?\s*[:]}, $tag;
push @tags, @new_tags;
$package->_export_messages(
{ namespace => $caller,
messages => \@messages,
export_tags => \@tags,
view all matches for this distribution
view release on metacpan or search on metacpan
t/01metrics.t view on Meta::CPAN
qr/^the_distribution_bytes_count 1\nthe_distribution_bytes_sum 10000/m,
'Net::Prometheus->render contains Histogram metric'
);
# Buckets
my @buckets = grep { m/^the_distribution_bytes_bucket/ } split m/\n/, $prom->render;
is( \@buckets,
[
'the_distribution_bytes_bucket{le="100"} 0',
'the_distribution_bytes_bucket{le="1000"} 0',
'the_distribution_bytes_bucket{le="10000"} 1',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Metrics/Any/Adapter/SignalFx.pm view on Meta::CPAN
my %labelledstats;
if( $labelnames ) {
foreach my $name ( keys %$stats ) {
my $value = $stats->{$name};
my @parts = split m/\./, $name;
$parts[-1] = _labels( $labelnames, $labelvalues ) . $parts[-1];
$name = join ".", @parts;
$labelledstats{$name} = $value;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Metrics/Any/Adapter.pm view on Meta::CPAN
sub split_type_string
{
shift;
my ( $str ) = @_;
my ( $type, $argstr ) = split m/[:,]/, $str, 2;
my @args;
while( length $argstr ) {
if( $argstr =~ m/^\[/ ) {
# Extract the entire contents of the [...] bracket
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Minilla/FileGatherer.pm view on Meta::CPAN
my $skip = maniskip('MANIFEST.SKIP') ;
@files = grep { !$skip->($_) } @files;
}
unless ($self->include_dotfiles) {
@files = grep {
!(grep { $_ =~ qr/^\./ } split m!/!, _normalize($_))
} @files;
}
if ($^O eq 'MSWin32') {
@files = map {
my $x = $_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Minion/Util.pm view on Meta::CPAN
my ($field, $name, $min, $max, $names) = @_;
my $is_star = $field eq '*' ? 1 : 0;
my %set;
for my $part (split /,/, $field) {
my ($range, $step) = split m{/}, $part, 2;
$step //= 1;
croak qq{Invalid step "$step" in $name field} unless $step =~ /^[1-9]\d*$/;
my ($a, $b);
if ($range eq '*') { ($a, $b) = ($min, $max) }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mira/Control/Static.pm view on Meta::CPAN
$name =~ s{^_}{};
$name = lc $name;
if ($dir =~ /\Q$floor_path\E(.*)/)
{
my $target = $1;
my @root_path = split m{/|\\|::}, $config->{$floor}->{root};
my $address = catdir($source, $publishdir, @root_path, $target, $name);
push @{$self->{$floor}}, {path => $static, address => $address} ;
}
}
}
my @main_root_path = split m{/|\\|::}, $config->{_default}->{static};
-d catdir($source, 'statics') and $self->{_default} = [{
path => catdir($source, 'statics'),
address => catdir($source, $publishdir, @main_root_path)
}];
view all matches for this distribution
view release on metacpan or search on metacpan
# Global values.
if (any { $self->{$key} eq $_ } @BORDER_GLOBAL) {
return;
}
my @parts = split m/\s+/ms, $self->{$key}, 3;
if (@parts == 1) {
_check_border_style($self->{$key}, $key);
} elsif (@parts == 2) {
# Border style on first place.
;
}
} elsif ($value =~ m/^($funcs)\((.*)\)$/ms) {
my $func = $1;
my $args_string = $2;
my @args = split m/\s*,\s*/ms, $args_string;
if ($func eq 'rgb') {
if (@args != 3) {
err "Parameter '$key' has bad rgb color (bad number of arguments).",
'Value', $error_value,
;
view all matches for this distribution
view release on metacpan or search on metacpan
t/Mock-Person-CZ/09-name.t view on Meta::CPAN
# Test.
my $ret1 = name();
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Default name must be three words.');
# Test.
my @ret = split m/\ /ms, $ret1;
my @first = (@Mock::Person::CZ::first_male, @Mock::Person::CZ::first_female);
my $ret2 = any { $ret[0] eq $_ } @first;
is($ret2, 1, 'First name is really from first male/female names.');
# Test.
t/Mock-Person-CZ/09-name.t view on Meta::CPAN
# Test.
$ret1 = name('male');
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Male name must be three words.');
# Test.
@ret = split m/\ /ms, $ret1;
my @first_males = @Mock::Person::CZ::first_male;
$ret2 = any { $ret[0] eq $_ } @first_males;
is($ret2, 1, 'First name is really from first male names.');
# Test.
t/Mock-Person-CZ/09-name.t view on Meta::CPAN
# Test.
$ret1 = name('female');
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Female name must be three words.');
# Test.
@ret = split m/\ /ms, $ret1;
my @first_females = @Mock::Person::CZ::first_female;
$ret2 = any { $ret[0] eq $_ } @first_females;
is($ret2, 1, 'First name is really from first female names.');
# Test.
view all matches for this distribution
view release on metacpan or search on metacpan
t/Mock-Person-DE/09-name.t view on Meta::CPAN
# Test.
my $ret1 = name('male');
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Default name must be three words.');
# Test.
my @ret = split m/\ /ms, $ret1;
my @first_males = @Mock::Person::DE::first_male;
my $ret2 = any { $ret[0] eq $_ } @first_males;
is($ret2, 1, 'First name is really from first male names.');
# Test.
t/Mock-Person-DE/09-name.t view on Meta::CPAN
# Test.
$ret1 = name('male');
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Male name must be three words.');
# Test.
@ret = split m/\ /ms, $ret1;
$ret2 = any { $ret[0] eq $_ } @first_males;
is($ret2, 1, 'First name is really from first male names.');
# Test.
$ret2 = any { $ret[1] eq $_ } @middle_males;
t/Mock-Person-DE/09-name.t view on Meta::CPAN
# Test.
$ret1 = name('female');
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Female name must be three words.');
# Test.
@ret = split m/\ /ms, $ret1;
my @first_females = @Mock::Person::DE::first_female;
$ret2 = any { $ret[0] eq $_ } @first_females;
is($ret2, 1, 'First name is really from first female names.');
# Test.
view all matches for this distribution
view release on metacpan or search on metacpan
t/Mock-Person-EN/09-name.t view on Meta::CPAN
my $ret1 = name();
like($ret1, qr{^\w+\ \w+\ \w+\ ?\w+?$},
'Default name must be three or four words.');
# Test.
my @ret = split m/\ /ms, $ret1;
if (@ret == 4) {
@ret = split m/\ /ms, $ret1, 3;
}
my @first_males = @Mock::Person::EN::first_male;
my @first_females = @Mock::Person::EN::first_female;
my $ret2 = any { $ret[0] eq $_ } @first_males, @first_females;
is($ret2, 1, 'First name is really from first male/female names.');
t/Mock-Person-EN/09-name.t view on Meta::CPAN
$ret1 = name('male');
like($ret1, qr{^\w+\ \w+\ \w+\ ?\w+?$},
'Male name must be three or four words.');
# Test.
@ret = split m/\ /ms, $ret1;
if (@ret == 4) {
@ret = split m/\ /ms, $ret1, 3;
}
$ret2 = any { $ret[0] eq $_ } @first_males;
is($ret2, 1, 'First name is really from first male names.');
# Test.
t/Mock-Person-EN/09-name.t view on Meta::CPAN
# Test.
$ret1 = name('female');
like($ret1, qr{^\w+\ \w+\ \w+\ ?\w+?$}, 'Female name must be three words.');
# Test.
@ret = split m/\ /ms, $ret1;
if (@ret == 4) {
@ret = split m/\ /ms, $ret1, 3;
}
$ret2 = any { $ret[0] eq $_ } @first_females;
is($ret2, 1, 'First name is really from first female names.');
# Test.
view all matches for this distribution
view release on metacpan or search on metacpan
t/Mock-Person-SK-ROM/09-name.t view on Meta::CPAN
$Mock::Person::SK::ROM::TYPE = 'three';
my $ret1 = name();
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Default name must be three words.');
# Test.
my @ret = split m/\ /ms, $ret1;
my @first_males = @Mock::Person::SK::ROM::first_male;
my @first_females = @Mock::Person::SK::ROM::first_female;
my $ret2 = any { $ret[0] eq $_ } @first_males, @first_females;
is($ret2, 1, 'First name is really from first male names.');
t/Mock-Person-SK-ROM/09-name.t view on Meta::CPAN
# Test.
$ret1 = name('male');
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Male name must be three words.');
# Test.
@ret = split m/\ /ms, $ret1;
$ret2 = any { $ret[0] eq $_ } @first_males;
is($ret2, 1, 'First name is really from first male names.');
# Test.
$ret2 = any { $ret[1] eq $_ } @middle_males;
t/Mock-Person-SK-ROM/09-name.t view on Meta::CPAN
# Test.
$ret1 = name('female');
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Female name must be three words.');
# Test.
@ret = split m/\ /ms, $ret1;
$ret2 = any { $ret[0] eq $_ } @first_females;
is($ret2, 1, 'First name is really from first female names.');
# Test.
@middle_females = @Mock::Person::SK::ROM::middle_female;
view all matches for this distribution
view release on metacpan or search on metacpan
t/Mock-Person-SK/09-name.t view on Meta::CPAN
# Test.
my $ret1 = name();
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Default name must be three words.');
# Test.
my @ret = split m/\ /ms, $ret1;
my @first_males = @Mock::Person::SK::first_male;
my $ret2 = any { $ret[0] eq $_ } @first_males;
is($ret2, 1, 'First name is really from first male names.');
# Test.
t/Mock-Person-SK/09-name.t view on Meta::CPAN
# Test.
$ret1 = name('male');
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Male name must be three words.');
# Test.
@ret = split m/\ /ms, $ret1;
$ret2 = any { $ret[0] eq $_ } @first_males;
is($ret2, 1, 'First name is really from first male names.');
# Test.
$ret2 = any { $ret[1] eq $_ } @middle_males;
t/Mock-Person-SK/09-name.t view on Meta::CPAN
# Test.
$ret1 = name('female');
like($ret1, qr{^\w+\ \w+\ \w+$}, 'Female name must be three words.');
# Test.
@ret = split m/\ /ms, $ret1;
my @first_females = @Mock::Person::SK::first_female;
$ret2 = any { $ret[0] eq $_ } @first_females;
is($ret2, 1, 'First name is really from first female names.');
# Test.
view all matches for this distribution
view release on metacpan or search on metacpan
devel/curversion view on Meta::CPAN
$version = $v->numify;
}
if ($options->{'-i'}) {
my $v = version->new($version);
my @digits = split m/\./, $v->stringify;
$digits[-1]++;
$v = version->new( join q{.}, @digits );
$version = $v->stringify;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Build/Functions.pm view on Meta::CPAN
extra_compiler_flags($f);
}
}
if ( $flag =~ m{\s} ) {
my @flags = split m{\s+}, $flag;
foreach my $f (@flags) {
extra_compiler_flags($f);
}
} else {
_create_arrayref('extra_compiler_flags');
inc/Module/Build/Functions.pm view on Meta::CPAN
extra_linker_flags($f);
}
}
if ( $flag =~ m{\s} ) {
my @flags = split m{\s+}, $flag;
foreach my $f (@flags) {
extra_linker_flags($f);
}
} else {
_create_arrayref('extra_linker_flags');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Build/JSAN.pm view on Meta::CPAN
next if $file =~ m{^t/}; # Skip things in t/
# Assume that the file name corresponds to the library. This may need
# to be more sophisticated in the future, but will do for now.
(my $lib = $file) =~ s|^[^/]+/||;
$lib = join '.', split m{/}, $lib;
$lib =~ s/\.js$//;
$out{$lib} = {
file => $dist_files{$file},
version => $self->_parse_version($lib, $file),
};
lib/Module/Build/JSAN.pm view on Meta::CPAN
return \%out;
}
sub _parse_version {
my ($self, $lib, $file) = @_;
my $version_from = File::Spec->catfile( split m{/}, $file );
open VF, "<$version_from" or die "Cannot open '$version_from': $!\n";
my $version = '';
my $find = qr/VERSION\s*(?:=|:)\s*[^\d._]*([\d._]+)/;
while (<VF>) {
last if ($version) = /$find/;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Build/Base.pm view on Meta::CPAN
@{ $self->rscan_dir($dir, $self->file_qr("\\.$type\$")) } };
}
sub localize_file_path {
my ($self, $path) = @_;
return File::Spec->catfile( split m{/}, $path );
}
sub localize_dir_path {
my ($self, $path) = @_;
return File::Spec->catdir( split m{/}, $path );
}
sub fix_shebang_line { # Adapted from fixin() in ExtUtils::MM_Unix 1.35
my ($self, @files) = @_;
my $c = ref($self) ? $self->{config} : 'Module::Build::Config';
view all matches for this distribution
view release on metacpan or search on metacpan
cpants/templates/static/news view on Meta::CPAN
href="http://cpants.perl.org/static/sqlite/cpants_all.db.gz">http://cpants.perl.org/static/sqlite/cpants_all.db.gz</a>.<br>
Have fun playing with the data!
</dd>
<dt>2006-11-04: metayml_conforms_spec_1_0 and _current</dt>
<dd>After some discussions on perl-qa I split metayml_conforms_spec into metayml_conforms_spec_1_0 and
metayml_conforms_spec_current (which is an optional metric).</dd>
<dt>2006-10-30: More Graphs & has_license changes</dt>
<dd>There are now graphs showing the kwalitee of a distribution and the
average kwalitee and number of dists of an author over time. They are located
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Install/ParseRequires.pm view on Meta::CPAN
else {
$method = 'requires';
}
$requires = shift;
for my $line ( split m/\n/, $requires ) {
s/^\s*//, s/\s*$// for $line;
if ( $line =~ m/^([\w\=]+):$/ ) {
$method = _parse_requires_method $1;
}
else {
my ( $dist, $version ) = split m/\s+/, $line, 2;
$version ||= 0;
$self->$method( $dist => $version );
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Build/Functions.pm view on Meta::CPAN
extra_compiler_flags($f);
}
}
if ( $flag =~ m{\s} ) {
my @flags = split m{\s+}, $flag;
foreach my $f (@flags) {
extra_compiler_flags($f);
}
} else {
_create_arrayref('extra_compiler_flags');
inc/Module/Build/Functions.pm view on Meta::CPAN
extra_linker_flags($f);
}
}
if ( $flag =~ m{\s} ) {
my @flags = split m{\s+}, $flag;
foreach my $f (@flags) {
extra_linker_flags($f);
}
} else {
_create_arrayref('extra_linker_flags');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/License/Report/CPANPLUSModule.pm view on Meta::CPAN
# Check for any of the following phrases (Change spaces to \s+)
my @phrases = (
'under the same (?:terms|license) as Perl itself',
);
my $regex = join q{|}, map {join '\\s+', split m/\s+/xms, $_} @phrases;
if ($licensetext =~ m/$regex/ixms)
{
return 'perl';
}
}
lib/Module/License/Report/CPANPLUSModule.pm view on Meta::CPAN
if ($buildfile =~ m/([\'\"]?)module_name\1\s*(?:=>|,)\s*(\"[^\"]+|\'[^\']+)/xms)
{
my $module_name = substr $2, 1; # remove leading quote
# This algorithm comes from Module::Build::Base::dist_version() v0.27_02
my $file = File::Spec->catfile('lib', split m/::/xms, $module_name) . '.pm';
$self->{buildfile}->{version_from} = $file;
}
elsif ($buildfile =~ m/([\'\"]?)dist_version_from\1\s*(?:=>|,)\s*(\"[^\"]+|\'[^\']+)/xms)
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Provision/Base.pm view on Meta::CPAN
option 'plugins' => is => 'ro', isa => ArrayRef[NonEmptySimpleStr],
documentation => 'Name of optional plugins to load, comma separated list',
builder => sub { [] }, format => 's', short => 'M',
coerce => sub { (is_arrayref $_[ 0 ])
? $_[ 0 ] : [ split m{ , }mx, $_[ 0 ] ] };
option 'project' => is => 'lazy', isa => NonEmptySimpleStr, format => 's',
documentation => 'Package name of the new projects main module';
option 'repository' => is => 'ro', isa => NonEmptySimpleStr, format => 's',
lib/Module/Provision/Base.pm view on Meta::CPAN
(map { s{ [-] }{::}gmx; $_ }
map { m{ \A [q\'\"] }mx ? eval $_ : $_ }
map { m{ \A \s* (?:module_name|module|name)
\s+ [=]?[>]? \s* ([^,;]+) [,;]? }imx }
grep { m{ \A \s* (module|name) }imx }
split m{ [\n] }mx, $_[ 0 ])[ 0 ];
};
my $_parse_manifest_line = sub { # Robbed from ExtUtils::Manifest
my $line = shift; my ($file, $comment);
lib/Module/Provision/Base.pm view on Meta::CPAN
lc_distname => lc $self->distname,
license => $self->license,
license_class => $self->license_keys->{ $self->license },
module => $project,
perl => $perl_ver,
prefix => (split m{ :: }mx, lc $project)[ -1 ],
project => $project,
pub_repo_prefix => $config->pub_repo_prefix,
use_perl => $perl_code,
version => $self->VERSION, };
}
view all matches for this distribution
view release on metacpan or search on metacpan
script/release view on Meta::CPAN
$release->_print("============ Testing with $perl (", $n++, "/$N)\n");
$release->set_perl( $perl ) or next;
$release->clean;
foreach my $mod ( grep m/\S/ => split m/\s*,\s*/ => $required ) {
system "$perl -M$mod -e1 >/dev/null 2>&1";
if( $? ) {
warn "Prereq $mod not available\n";
next PERL;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Starter/CSJEWELL.pm view on Meta::CPAN
[ 'xt', 'author', 'version.t' ],
);
my %contents_of = do {
local $INPUT_RECORD_SEPARATOR = undef;
( q{}, split m{_____\[ [ ] (\S+) [ ] \]_+\n}smx, <DATA> );
};
for ( values %contents_of ) {
s/^!=([[:lower:]])/=$1/gxms;
}
view all matches for this distribution