view release on metacpan or search on metacpan
lib/Acme/Module/Authors.pm view on Meta::CPAN
return $_;
}
sub author_for {
my $name = shift;
my $module = CPAN::Shell->expand(Module => $name);
# ignore perl-core pragmas like overload, constant, strict ...
return if !$module or
($name =~ /^[a-z]/ and $module->cpan_file =~ m!perl-[\d\.]+\.tar\.gz$!);
my $author = CPAN::Shell->expand(Author => $module->userid);
return $author->name;
}
END {
$in_end = 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/POE/Acronym/Generator.pm view on Meta::CPAN
print $acronym, "\n";
}
=head1 DESCRIPTION
What does POE stand for?" is a common question, and people have expanded the acronym in several ways.
Acme::POE::Acronym::Generator produces randomly generated expansions of the POE acronym ( or at your
option any other arbitary word ).
=head1 CONSTRUCTOR
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
print "*** Installing $pkg...\n";
my $obj = CPAN::Shell->expand( Module => $pkg );
my $success = 0;
if ( $obj and defined( _version_check( $obj->cpan_version, $ver ) ) ) {
my $pathname = $pkg;
$pathname =~ s/::/\\W/;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
print "*** Installing $pkg...\n";
my $obj = CPAN::Shell->expand( Module => $pkg );
my $success = 0;
if ( $obj and _version_cmp( $obj->cpan_version, $ver ) >= 0 ) {
my $pathname = $pkg;
$pathname =~ s/::/\\W/;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
#line 1 "inc/Module/Install.pm - /usr/share/perl5/Module/Install.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install.pm $ $Author: autrijus $
# $Revision: #68 $ $Change: 2285 $ $DateTime: 2004/07/01 03:16:20 $ vim: expandtab shiftwidth=4
package Module::Install;
$VERSION = '0.34';
die << "." unless $INC{join('/', inc => split(/::/, __PACKAGE__)).'.pm'};
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
print "*** Installing $pkg...\n";
my $obj = CPAN::Shell->expand( Module => $pkg );
my $success = 0;
if ( $obj and _version_cmp( $obj->cpan_version, $ver ) >= 0 ) {
my $pathname = $pkg;
$pathname =~ s/::/\\W/;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Pythonic.pm view on Meta::CPAN
if (!$joining) {
$unbalanced_paren = left_parenthesize($line);
$might_be_modifier = $line =~ /^\s*(?:if|unless|while|until|for|foreach)\b/;
$line_with_modifier = \$line if $might_be_modifier;
($indent) = $line =~ /^(\s*)/;
$indent = length(expand($indent));
}
if ($line =~ /(?:,|=>)\s*$/ || $line =~ s/\\\s*$//) {
++$joining;
next if $joining > 1; # if 1 we need yet to handle indentation
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
print "*** Installing $pkg...\n";
my $obj = CPAN::Shell->expand( Module => $pkg );
my $success = 0;
if ( $obj and defined( _version_check( $obj->cpan_version, $ver ) ) ) {
my $pathname = $pkg;
$pathname =~ s/::/\\W/;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Siteswap.pm view on Meta::CPAN
}
# extend the pattern by the number of throws equal to the biggest
# throw in the pattern, to ensure that every throw in the pattern
# lands at least once.
sub _expand_throws {
my ($throws) = @_;
my $max_throw = _max_throw($throws);
foreach my $i (0 .. $max_throw) {
# if it's a multiplex throw, we want to copy it
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Sort/Bozo.pm view on Meta::CPAN
guarantee that any particular sort will come in anywhere near average. Where the bogosort is a 'stateless'
sort, the bozo sort maintains a list state from one iteration to the next, but its decision mechanism for swaps I<is>
stateless; it blindly swaps any random two elements.
Keep in mind that a list of five items consumes an average of 5 * 5!, or 600 iterations. 10! is
36,288,000 iterations on average. The universe will either collapse or expand to the point that it cannot sustain
life long before the Bozo sort manages to sort a deck of cards, in the average case. In the worst case, all of the
background radiation from our universe will have decayed to the point that there is no longer any trace of our
existence before this sort manages to alphabetically sort your social networking friends list.
Test with short (4 to 7 element) lists, and be prepared to kill the process if you mistakenly hand it more elements
view all matches for this distribution
view release on metacpan or search on metacpan
local/lib/perl5/Module/Build/Base.pm view on Meta::CPAN
return $p->{test_files} = (@_ == 1 ? shift : [@_]);
}
return $self->find_test_files;
}
sub expand_test_dir {
my ($self, $dir) = @_;
my $exts = $self->{properties}{test_file_exts};
return sort map { @{$self->rscan_dir($dir, qr{^[^.].*\Q$_\E$})} } @$exts
if $self->recursive_test_files;
local/lib/perl5/Module/Build/Base.pm view on Meta::CPAN
my $self = shift;
my $p = $self->{properties};
if (my $files = $p->{test_files}) {
$files = [sort keys %$files] if ref $files eq 'HASH';
$files = [map { -d $_ ? $self->expand_test_dir($_) : $_ }
map glob,
$self->split_like_shell($files)];
# Always given as a Unix file spec.
return [ map $self->localize_file_path($_), @$files ];
} else {
# Find all possible tests in t/ or test.pl
my @tests;
push @tests, 'test.pl' if -e 'test.pl';
push @tests, $self->expand_test_dir('t') if -e 't' and -d _;
return \@tests;
}
}
sub _find_file_by_type {
view all matches for this distribution
view release on metacpan or search on metacpan
return scalar $file =~ $re;
}
sub bite {
my ($self, $file) = @_;
# we need to expand this test to include other Damian modules.
if (victim($file)) {
carp "$file doesn't like spiders";
return 0;
}
return undef;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
print "*** Installing $pkg...\n";
my $obj = CPAN::Shell->expand( Module => $pkg );
my $success = 0;
if ( $obj and _version_cmp( $obj->cpan_version, $ver ) >= 0 ) {
my $pathname = $pkg;
$pathname =~ s/::/\\W/;
view all matches for this distribution
view release on metacpan or search on metacpan
perlcritic.rc view on Meta::CPAN
[ValuesAndExpressions::RequireUpperCaseHeredocTerminator]
[ValuesAndExpressions::RestrictLongStrings]
[ValuesAndExpressions::UnexpandedSpecialLiteral]
[Variables::ProhibitAugmentedAssignmentInDeclaration]
[Variables::ProhibitConditionalDeclarations]
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
#line 1 "inc/Module/Install.pm - /usr/share/perl5/Module/Install.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install.pm $ $Author: autrijus $
# $Revision: #68 $ $Change: 2285 $ $DateTime: 2004/07/01 03:16:20 $ vim: expandtab shiftwidth=4
package Module::Install;
$VERSION = '0.34';
die << "." unless $INC{join('/', inc => split(/::/, __PACKAGE__)).'.pm'};
view all matches for this distribution
view release on metacpan or search on metacpan
version 0.13 (09/21/2005):
* No changes, accidently uploaded 0.11 as 0.12, bump version so I can
upload this to CPAN.
version 0.12 (09/21/2005):
* Fix dumb logic in the constructor and expand the test cases to be more
complete.
version 0.11 (08/10/2005):
* Swap to using ref to ensure that a reference is an Acme::Wabby object
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Adapter/Async/Model.pm view on Meta::CPAN
$defined{$pkg} = 1;
$args{defer_methods} = 1 unless exists $args{defer_methods};
($args{model_base} = $pkg) =~ s/Model\K.*// unless exists $args{model_base};
my $type_expand = sub {
my ($type) = @_;
return unless defined $type;
$type = $args{model_base} . $type if substr($type, 0, 2) eq '::';
$type
};
lib/Adapter/Async/Model.pm view on Meta::CPAN
UnorderedMap => 'Adapter::Async::UnorderedMap::Hash',
OrderedList => 'Adapter::Async::OrderedList::Array',
);
if(defined(my $from = $details->{from})) {
$log->tracef("Should apply field %s from %s for %s", $k, $from, $pkg);
++$loader{$_} for grep /::/, map $type_expand->($_), @{$details}{qw(type)};
} else {
no strict 'refs';
no warnings 'once';
push @{$pkg . '::attrs'}, $k unless $details->{collection}
}
if(my $type = $details->{collection}) {
my $collection_class = $collection_class_for{$type} // die "unknown collection $type";
++$loader{$collection_class};
$log->tracef("%s->%s collection: %s", $pkg, $k, $type);
++$loader{$_} for grep /::/, map $type_expand->($_), @{$details}{qw(key item)};
$code = sub {
my $self = shift;
die "no args expected" if @_;
$self->{$k} //= $collection_class->new;
}
} else {
my $type = $type_expand->($details->{type} // die "unknown type in package $pkg - " . Dumper($def));
++$loader{$type} if $type =~ /::/;
$log->tracef("%s->%s scalar %s", $pkg, $k, $type);
$code = sub {
my ($self) = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
#######################################
=item $bool = $cfg->chk_if_still_uses_variables ( $tag[, $override_inherit] );
This function looks up the requested tag in the current section of the config
file and returns if the tag's value contained variables that failed to expand
when the config file was parsed. (B<1> - has variable, B<0> - none.)
If the tag doesn't exist, or you called C<set_value> to create it, this function
will always return B<0> for that tag!
view all matches for this distribution
view release on metacpan or search on metacpan
infix/include/infix/infix.h view on Meta::CPAN
*
* @details This attribute is used to issue a compiler warning if the return value
* of a function is ignored by the caller. This is extremely useful for catching
* bugs where an error code or an important result is not checked.
*
* This macro expands to:
* - `[[nodiscard]]` on compilers that support the C23 standard syntax.
* - `__attribute__((warn_unused_result))` on GCC and Clang.
* - `_Check_return_` on Microsoft Visual C++.
* - Nothing on other compilers.
*
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();
CPAN::Shell->install('Module::Build::Compat');
CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
or die "Couldn't install Module::Build, giving up.\n";
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
eval "use Module::Build::Compat 0.02; 1" or die $@;
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();
CPAN::Shell->install('Module::Build::Compat');
CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
or die "Couldn't install Module::Build, giving up.\n";
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
eval "use Module::Build::Compat 0.02; 1" or die $@;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Aion/Format.pm view on Meta::CPAN
caller_info => 1,
#output => 'stdout',
unicode_charnames => 1,
%$properties,
class => {
expand => "all",
inherited => "all",
show_reftype => 1,
%{$properties->{class}},
},
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Aion/Meta/FeatureConstruct.pm view on Meta::CPAN
cleaner => '',
weaken => 'Scalar::Util::weaken(%(get)s);',
}, ref $cls || $cls;
}
sub add_attr { shift->_expand('attr', @_) }
sub add_preset { shift->_expand('preset', @_) }
sub add_trigger { shift->_expand('trigger', @_) }
sub add_cleaner { shift->_expand('cleaner', @_) }
sub add_access { shift->_expand('access', @_) }
sub add_release {
my $self = shift;
@$self{qw/getvar ret/} = ('my $val = %(get)s;', '$val') if $self->{ret} eq '';
$self->_expand('release', @_)
}
sub _expand(@) {
my ($self, $key, $code, $shift) = @_;
if(ref $self->{$key}) {
if($shift) { unshift @{$self->{$key}}, $code }
else { push @{$self->{$key}}, $code }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
print "*** Installing $pkg...\n";
my $obj = CPAN::Shell->expand( Module => $pkg );
my $success = 0;
if ( $obj and defined( _version_check( $obj->cpan_version, $ver ) ) ) {
my $pathname = $pkg;
$pathname =~ s/::/\\W/;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/BinPack/2D.pm view on Meta::CPAN
# vim: set expandtab ts=4 sw=4 nowrap ft=perl ff=unix :
package Algorithm::BinPack::2D;
use strict;
use warnings;
use Carp;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/BreakOverlappingRectangles.pm view on Meta::CPAN
Returns an array ref (actually a tied one) containing the broken
rectangles.
Rectangles are stored inside Algorithm::BreakOverlappingRectangles
objects as packed data to reduce memory comsumption, but calling the
C<get_rectangles> method expands them and so can eat lots of memory
when the number of rectangles is high. This alternative method returns
a reference to a tied array that unpacks the rectangles on the fly.
For instance:
view all matches for this distribution
view release on metacpan or search on metacpan
t/test.data view on Meta::CPAN
now RB B
a DT B
lieutenant NN I
colonel NN I
, , O
expanded VBD O
his PRP$ B
contacts NNS I
to TO O
include VB O
the DT B
t/test.data view on Meta::CPAN
During IN O
the DT B
Reagan NNP I
years NNS I
he PRP B
expanded VBD O
his PRP$ B
business NN I
and CC I
intelligence NN I
contacts NNS I
t/test.data view on Meta::CPAN
factories NNS I
, , I
mines NNS I
and CC I
utilities NNS I
expanded VBN O
at IN O
an DT B
annual JJ I
rate NN I
of IN O
t/test.data view on Meta::CPAN
after IN O
his PRP$ B
regulatory JJ I
role NN I
was VBD O
expanded VBN O
by IN O
the DT B
new JJ I
savings-and-loan JJ I
bailout NN I
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
print "*** Installing $pkg...\n";
my $obj = CPAN::Shell->expand( Module => $pkg );
my $success = 0;
if ( $obj and defined( _version_check( $obj->cpan_version, $ver ) ) ) {
my $pathname = $pkg;
$pathname =~ s/::/\\W/;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/Cron.pm view on Meta::CPAN
%WDAYS = map { lc(strftime "%a", 0,0,0, 4+$_, 0, 70), $_ } 0 .. 6;
setlocale( LC_TIME, $old_loc );
}
sub _expand_set
{
my ( $spec, $kind ) = @_;
return undef if $spec eq "*";
lib/Algorithm/Cron.pm view on Meta::CPAN
}, $class;
foreach ( @FIELDS_CTOR ) {
next unless exists $params{$_};
$self->{$_} = _expand_set( delete $params{$_}, $_ );
!defined $self->{$_} or scalar @{ $self->{$_} } or
croak "Require at least one value for '$_' field";
}
return $self;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/DBSCAN.pm view on Meta::CPAN
}
}
=head2 ExpandCluster
This method will expand the cluster starting by the neighborhood of point $point
=cut
sub ExpandCluster {
my ($self, $point, $neighborPts) = @_;
lib/Algorithm/DBSCAN.pm view on Meta::CPAN
$point->{cluster_id} = $self->{current_cluster};
my %cluster_points;
map { $cluster_points{$_}++ } @$neighborPts;
my $cluster_expanded = 0;
do {
$cluster_expanded = 0;
foreach my $id (keys %cluster_points) {
my $p = $self->{dataset}->{$id};
unless ($p->{visited}) {
$p->{visited} = 1;
$self->_one_more_point_visited();
lib/Algorithm/DBSCAN.pm view on Meta::CPAN
my $neighborPtsOfClusterMember = $self->GetRegion($p);
if (scalar(@$neighborPtsOfClusterMember) >= $self->{min_points}) {
map { $cluster_points{$_}++ } @$neighborPtsOfClusterMember;
say "Cluster [$self->{current_cluster}] has now [".scalar(keys %cluster_points)."] members, added region of point:[$p->{point_id}]";
$cluster_expanded = 1;
last;
}
}
$p->{cluster_id} = $self->{current_cluster} unless($p->{cluster_id});
}
}
while($cluster_expanded);
}
}
=head2 GetRegion
view all matches for this distribution