view release on metacpan or search on metacpan
bin/eva-titlenize view on Meta::CPAN
use warnings;
use utf8;
use Acme::EvaTitlenize;
use Encode;
use Getopt::Long qw(:config posix_default no_ignore_case gnu_compat);
my $upper_right;
Getopt::Long::GetOptions(
'u' => \$upper_right,
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Makefile.pm view on Meta::CPAN
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing, always use defaults
if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
view all matches for this distribution
view release on metacpan or search on metacpan
demo/sightly.pl view on Meta::CPAN
This creates eyesore, a sightly-encoded file.
To decode it: perl eyesore > f.tmp
To check it worked: cmp f.tmp some_binary_file
Notes:
If no shape is specified, a single (very long) line will be output.
If a shape, but no file, is specified, a default no-op filler will
be used to fill the shape.
EOM
exit 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
=item I<namespace>
(scalar or object(!) B<ref>)
Sets a context for various parts of I<{fsm}> and services would be resolved.
No defaults.
Refer to L<B<query()> method|/query()> documentation for details.
=item I<source>
(scalar or C<CODE>)
be in fact queried through L<B<fst()> method|/fst()> turn map needs bit more
sophisticated handling;
and that's what B<turn()> does;
in fact asking for C<turns> will result in B<croak>.
I<$action> of C<START> and C<CONTINUE> special states suffer implicit
defaulting to empty string.
=item anything else
No arguments or more then two is an non-fatal error.
Returns C<undef> (with B<carp>).
defined $self->{_}{namespace} or croak
qq|[$caller]: {namespace} !isa defined|;
my $anchor = $self->{_}{namespace};
my $backup = $topic;
if( ref $anchor eq '' && $anchor eq '' ) {
$self->diag( 5, q|[%s]: defaulting %s to $self|, $caller, $manifest );
$anchor = $self }
$self->diag( 5, q|[%s]: {namespace} isa (%s)|, $caller, ref $anchor );
unless( ref $anchor eq '' ) {
$self->diag( 5, q|[%s]: going for <%s>->[%s]|,
$caller, ref $anchor, $topic );
sub query_dumper {
my $self = shift @_;
return $self->verify(
$self->query(
# TODO:202202210258:whynot: This is inefficient, defaulting should happen in B<connect()> instead.
$self->{_}{dumper} // sub { sprintf q|(%s)|, $_[1] // q|undef| },
q|{dumper}|, @_ ) // q|(unclear)|,
# XXX:202202210304:whynot: 'source' looks like remnants of refactoring. Should investigate it deeper.
$self->state, qw| source source |, '' ) }
=item Default For Turn Map
B<(missing feature)>
It's not hard to imagine application of rather limited turn map that should
default on anything else deemed irrelevant.
Right now to achieve logic like this such defaulting ought to be merged into
B<switch()>.
That's insane.
=item Diagnostics
=item C<[query]: [query_switch]: {namespace} isa (%s)>
B<(deep trace)>, L<B<query()> method|/query()>.
C<ref $namespace> is I<%s>.
=item C<[query]: [query_dumper]: defaulting %s to $self>
=item C<[query]: [query_source]: defaulting %s to $self>
=item C<[query]: [query_switch]: defaulting %s to $self>
B<(deep trace)>, L<B<query()> method|/query()>.
I<$namespace> is an empty string.
The blackboard object will be used to resolve the callback.
}
}
Again, B<source()> supposedly produces some numbers.
Then some kind of FizBuzz happens.
Also, returning C<undef> as default raises questions.
However, it's acceptable for example.
Now, quick demonstration, that's how this FizzBuzz would look
using B<DMA::FSM> capabilities (and B<A::F> of I<v2.2.7> syntax).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/FishFarm.pm view on Meta::CPAN
=head1 SYSTEM INSTALLATION RELATED SUBROUTINES
=head2 install_all_systems
Installs all the available systems the default way and returns them as a list of C<Acme::FishFarm::*> objects in the following sequence:
(Feeder, OxygenMaintainer, WaterConditionMonitor, WaterLevelMaintainer, WaterFiltration)
=cut
lib/Acme/FishFarm.pm view on Meta::CPAN
=head2 check_feeder ( $feeder, $verbose )
This checks, performs necessary actions and outputs the condition of the feeder. Each call will tick the clock inside the feeder. See C<Acme::FishFarm::Feeder> for more info.
If the food tank is empty, it will be filled to the default. So if you want to fill a different amount, please set the amount before hand. See C<Acme::FishFarm::Feeder>.
Setting C<$verbose> to 1 will give more output about the empty food tank.
Take note that this process B<DOES NOT> trigger the LED and buzzer if abnormal condition is present.
lib/Acme/FishFarm.pm view on Meta::CPAN
print $feeder->time_remaining, " hours left until it's time to feed the fish.\n";
}
if ( $feeder->food_remaining <= 0 ) {
print " !! Food tank empty!\n";
$feeder->refill; # default back to 500 cm^3
print " Refilled food tank back to ", $feeder->food_tank_capacity, " cm^3.\n";
}
print " Food Remaining: ", $feeder->food_remaining, "cm^3.\n";
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/AuthorTests.pm view on Meta::CPAN
my ($self, $dirs, $recurse) = @_;
return unless $Module::Install::AUTHOR;
my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t';
# XXX: pick a default, later -- rjbs, 2008-02-24
my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests";
@dirs = grep { -d } @dirs;
if ($recurse) {
require File::Find;
view all matches for this distribution
view release on metacpan or search on metacpan
Release history for Acme-Flat
0.001001 2017-03-07T15:34:24Z d6f7869
- Bugfix: fix test failure with -Ddefault_inc_excludes_dot
[Dependencies::Stats]
- Dependencies changed since 0.001000, see misc/*.deps* for details
- develop: +5 â2 -1 (suggests: â2)
- test: â1
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Makefile.pm view on Meta::CPAN
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing, always use defaults
if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Free/API/ChuckNorris.pm view on Meta::CPAN
shell>cnq categories | xargs -I% cnq random --category %
=item C<random [--category STRING]>
The command that returns the random Chuch Noris quote. It is the default
command if none is specified:
shell> cnq random
Chuck Norris dunks onion rings in his morning coffee.
shell> nq random
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Free/Advice/Slip.pm view on Meta::CPAN
#
use overload '""' => sub ( $s, $u, $b ) { $s->{advice} // () };
#
sub _http ($uri) {
state $http
//= HTTP::Tiny->new( default_headers => { Accept => 'application/json' }, agent => sprintf '%s/%.2f ', __PACKAGE__, our $VERSION );
my $res = $http->get($uri); # {success} is true even when advice is not found but we'll at least know when we have valid JSON
$res->{success} ? decode_json( $res->{content} ) : ();
}
#
sub advice ( $slip_id //= () ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Free/Advice/Unsolicited.pm view on Meta::CPAN
#
use overload '""' => sub ( $s, $u, $b ) { $s->{advice} // () };
#
sub _http ($uri) {
state $http
//= HTTP::Tiny->new( default_headers => { Accept => 'application/json' }, agent => sprintf '%s/%.2f ', __PACKAGE__, our $VERSION );
my $res = $http->get($uri); # {success} is true even when advice is not found but we'll at least know when we have valid JSON
$res->{success} ? decode_json( $res->{content} ) : ();
}
#
sub advice ( $advice_id //= () ) {
view all matches for this distribution
view release on metacpan or search on metacpan
my $subcommand = shift @ARGV;
my $fletch = Acme::Free::Dog::API->new;
#>>>
dispatch {
xdefault shift, q{random};
}
$subcommand,
breeds => sub { exit do_breeds() },
help => sub { exit do_help() },
images => sub { exit do_images( \@ARGV ) },
view all matches for this distribution
view release on metacpan or search on metacpan
bin/freeapi view on Meta::CPAN
my $subcommand = shift @ARGV;
#>>>
dispatch {
xdefault shift, q{random};
}
$subcommand,
apis => sub { exit do_apis( \@ARGV ) },
random => sub { exit do_random( \@ARGV ) },
help => \&do_help,
view all matches for this distribution
view release on metacpan or search on metacpan
CONTRIBUTING view on Meta::CPAN
attach a diff file to a bug report. Unless otherwise stated, I'll
assume that your contributions are licensed under the same terms as
the rest of the project.
(If using git, feel free to work in a branch. For Mercurial, I'd
prefer bookmarks within the default branch.)
* Documentation
If there's anything unclear in the documentation, please submit this
as a bug report or patch as above.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Ghost.pm view on Meta::CPAN
=head2 logfile
logfile => '/var/log/myDaemon.log',
This attribute sets log file path. By default all log entries will be printed to syslog
See L<Acme::Ghost::Log/file>
=head2 logger
lib/Acme/Ghost.pm view on Meta::CPAN
This attribute perfoms to set predefined logger, eg. Mojo::Log.
If you set this attribute, the specified logger will be used as the preferred logger
=head2 loghandle
Log filehandle, defaults to opening "file" or uses syslog if file not specified
See L<Acme::Ghost::Log/handle>
=head2 loglevel
lib/Acme/Ghost.pm view on Meta::CPAN
=head2 flush
$self = $self->flush;
This internal method flush (resets) process counters to defaults. Please do not use this method in your inherits
=head2 is_daemonized
$g->is_daemonized or die "Your ghost process really is not a daemon"
lib/Acme/Ghost.pm view on Meta::CPAN
This example shows how to forced suppress reloading (disable send users signals to daemon)
=head2 reload
$exit_code = $g->reload; # SIGHUP (by default)
$exit_code = $g->reload('USR2'); # SIGUSR2
$exit_code = $g->reload(12); # SIGUSR2 too
say "Reloading ". $g->pid;
This method performs sending signal to Your daemon and return C<0> as exit code.
lib/Acme/Ghost.pm view on Meta::CPAN
1;
=item ghost_nobody.pl
This example shows how to start daemons over nobody user and logging to syslog (default)
my $g = MyGhost->new(
pidfile => '/tmp/daemon.pid',
user => 'nobody',
group => 'nogroup',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Github/Test.pm view on Meta::CPAN
This method prints the string scalar "Freep!" on standard out. It takes no input values. Returns a true
value.
=item * frobulate()
Takes an optional scalar value as input. The value '42' is the default value for this method. Returns the
passed value or the default. (That means if you pass 0 or some other untrue scalar value, the return value
will be false.)
=back
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
v0.001
- make it work
v0.002
- forgot to enfore 5.10 as a min
v0.03
- updated docs and test to show how to do a default
v0.05
- update to turn off warnings for smartmatch in 5.18
view all matches for this distribution
view release on metacpan or search on metacpan
},
{
"class" : "Dist::Zilla::Plugin::MakeMaker",
"config" : {
"Dist::Zilla::Role::TestRunner" : {
"default_jobs" : 1
}
},
"name" : "@Starter/MakeMaker",
"version" : "6.009"
},
},
{
"class" : "Dist::Zilla::Plugin::RunExtraTests",
"config" : {
"Dist::Zilla::Role::TestRunner" : {
"default_jobs" : 1
}
},
"name" : "@Starter/RunExtraTests",
"version" : "0.029"
},
view all matches for this distribution
view release on metacpan or search on metacpan
exclude_filename = README.pod ; skip this generated file
exclude_filename = README.mkdn ; skip this generated file
exclude_filename = META.json ; skip this generated file
exclude_filename = cpanfile ; skip this generated file
[PruneCruft] ; default stuff to skip
;[ManifestSkip] ; if -f MANIFEST.SKIP, skip those, too
; file modifications
[InsertCopyright] ; add copyright at "# COPYRIGHT"
; [PodWeaver] ; generate Pod
; build system
[ExecDir] ; include 'bin/*' as executables
[ShareDir] ; include 'share/' for File::ShareDir
[MakeMaker] ; create Makefile.PL
eumm_version = 6.17
default_jobs = 5
; manifest (after all generated files)
[Manifest] ; create MANIFEST
; copy cpanfile back to repo dis
[CheckMetaResources] ; ensure META has 'resources' data
[CheckPrereqsIndexed] ; ensure prereqs are on CPAN
[CheckChangesHasContent] ; ensure Changes has been updated
[RunExtraTests] ; ensure xt/ tests pass
default_jobs = 5
[TestRelease] ; ensure t/ tests pass
[ConfirmRelease] ; prompt before uploading
; releaser
view all matches for this distribution
view release on metacpan or search on metacpan
BEGIN {
use Exporter ();
use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
$VERSION = 0.01;
@ISA = qw (Exporter);
#Give a hoot don't pollute, do not export more than needed by default
@EXPORT = qw (gotol);
@EXPORT_OK = qw (gotol);
%EXPORT_TAGS = ();
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Makefile.pm view on Meta::CPAN
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing or non-interactive session, always use defaults
if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/window.pl view on Meta::CPAN
widget Window => contain {
info id => 'window';
set position => 'center';
prop title => 'Window Example';
prop opacity => 0.8;
prop 'default-width' => 640;
prop 'default-height' => 480;
on delete_event => \&quit;
};
};
$app->find('window')->show_all;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Has/Tiny.pm view on Meta::CPAN
$_->($hash) for @validator;
return $hash;
}
my $default_buildargs = sub
{
my $class = shift;
return +{
(@_ == 1 && ref($_[0]) eq q(HASH)) ? %{$_[0]} : @_
};
lib/Acme/Has/Tiny.pm view on Meta::CPAN
my $me = shift;
my ($method, %options) = @_;
my $class = $options{class} || caller;
my $build = $options{build};
my $buildargs = $options{buildargs} || $default_buildargs;
my $code = sub
{
my $class = shift;
my $self = bless($class->$buildargs(@_), $class);
lib/Acme/Has/Tiny.pm view on Meta::CPAN
my @code;
for my $a (sort keys %$attributes)
{
my $spec = $attributes->{$a};
if ($spec->{default})
{
push @code, sprintf(
'exists($self->{%s}) or $self->{%s} = $Acme::Has::Tiny::ATTRIBUTES{%s}{%s}{default}->();',
map perlstring($_), $a, $a, $class, $a,
);
}
elsif ($spec->{required})
{
lib/Acme/Has/Tiny.pm view on Meta::CPAN
Defaults to "ro".
=item C<< required => 1 >>
=item C<< default => $coderef >>
Defaults are always eager (not lazy).
=item C<< builder => $coderef | $method_name | 1 >>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Hello.pm view on Meta::CPAN
This document describes version 0.04 of B<Acme::Hello>.
=head1 SYNOPSIS
use Acme::Hello; # exports hello() by default
hello(); # procedure call interface
my $obj = Acme::Hello->new;
$obj->hello; # object-oriented interface
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/AuthorTests.pm view on Meta::CPAN
my ($self, $dirs, $recurse) = @_;
return unless $Module::Install::AUTHOR;
my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t';
# XXX: pick a default, later -- rjbs, 2008-02-24
my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests";
@dirs = grep { -d } @dirs;
if ($recurse) {
require File::Find;
view all matches for this distribution
view release on metacpan or search on metacpan
an object (i.e. a blessed reference).
=head2 EXPORT
By default, B<Acme::Holy> exports the method B<holy()> into the current
namespace. Aliases for B<holy()> (see below) may be imported upon request.
=head2 Methods
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Honkidasu.pm view on Meta::CPAN
add conversion specifier character '%(' to æ¬æ°åºãã
=head1 EXAMPLES
æ¬æ°åºã per hour. (default: per month)
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Hospital/Bed.pm view on Meta::CPAN
]
)
=head3 total_num_of_beds
Configure the total number of beds needed to win the game. The default is 20.
=head3 lifes
Configure the total number of lifes the player is allowed. The default is 3.
=head3 names
Configure the list of names used to generate patients. This is expected as an ArrayRef.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $HasCPANPLUS );
my ( $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly );
my ( $PostambleActions, $PostambleUsed );
# See if it's a testing or non-interactive session
_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN );
_init();
sub _accept_default {
$AcceptDefault = shift;
}
sub missing_modules {
return @Missing;
inc/Module/AutoInstall.pm view on Meta::CPAN
}
elsif ( $arg =~ /^--installdeps=(.*)$/ ) {
__PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
exit 0;
}
elsif ( $arg =~ /^--default(?:deps)?$/ ) {
$AcceptDefault = 1;
}
elsif ( $arg =~ /^--check(?:deps)?$/ ) {
$CheckOnly = 1;
}
inc/Module/AutoInstall.pm view on Meta::CPAN
$TestOnly = 1;
}
}
}
# overrides MakeMaker's prompt() to automatically accept the default choice
sub _prompt {
goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault;
my ( $prompt, $default ) = @_;
my $y = ( $default =~ /^[Yy]/ );
print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] ';
print "$default\n";
return $default;
}
# the workhorse
sub import {
my $class = shift;
inc/Module/AutoInstall.pm view on Meta::CPAN
)[0]
);
while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) {
my ( @required, @tests, @skiptests );
my $default = 1;
my $conflict = 0;
if ( $feature =~ m/^-(\w+)$/ ) {
my $option = lc($1);
inc/Module/AutoInstall.pm view on Meta::CPAN
print "[" . ( $FeatureMap{ lc($feature) } || $feature ) . "]\n";
$modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' );
unshift @$modules, -default => &{ shift(@$modules) }
if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward combatability
while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) {
if ( $mod =~ m/^-(\w+)$/ ) {
my $option = lc($1);
$default = $arg if ( $option eq 'default' );
$conflict = $arg if ( $option eq 'conflict' );
@tests = @{$arg} if ( $option eq 'tests' );
@skiptests = @{$arg} if ( $option eq 'skiptests' );
next;
inc/Module/AutoInstall.pm view on Meta::CPAN
or _prompt(
qq{==> Auto-install the }
. ( @required / 2 )
. ( $mandatory ? ' mandatory' : ' optional' )
. qq{ module(s) from CPAN?},
$default ? 'y' : 'n',
) =~ /^[Yy]/
)
)
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
elsif ( !$SkipInstall
and $default
and $mandatory
and
_prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
=~ /^[Nn]/ )
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/ICan/tSpell.pm view on Meta::CPAN
use HTTP::Tiny;
use URI::Escape;
use Carp qw/croak/;
attributes (
tiny => [Object, {lzy, default => sub {HTTP::Tiny->new}}],
base_url => [Str, {lzy, default => 'http://www.google.com/search?gws_rd=ssl&hl=en&q='}],
);
validate_subs (
get => { params => [ [Str] ], returns => [[HashRef]] },
spell_check => {
view all matches for this distribution