view release on metacpan or search on metacpan
lib/AWS/Lambda/Quick.pm view on Meta::CPAN
And then execute it locally. Rather than running as normal your script
will instead upload itself to AWS as a Lambda function (modifying
itself so that it no longer has a dependency on AWS::Lambda::Quick) and
handle all the other steps needed to make itself web accessible.
Running the script locally subsequent times will update the code and
AWS settings.
=head2 What This Actually Does
You probably don't care about this, but this is actually what's
going on when the script uploads itself. This is subject to change
lib/AWS/Lambda/Quick.pm view on Meta::CPAN
Each Lambda function we create gets its own method, which is where
AWS specifies what HTTP method it accepts (C<GET>,C<POST>,C<PUT>,
etc.) and how it decides who can access it.
This module always sets the type of method to C<ANY> (i.e. we always
call the lambda function and let it figure out what it wants to accept
or not.)
We setup the C<NONE> authentication, meaning anyone can call the API
over the internet - i.e. it's configured as a public API.
=head3 Create a new integration
Integrations are how AWS decides both where a request is routed to
lib/AWS/Lambda/Quick.pm view on Meta::CPAN
The name we stage to. By default this is C<quick> meaning that
our live URL will be of the form:
https://????.execute-api.????.amazonaws.com/quick/????
By setting stage_name to another value you can change this.
=item extra_layers
An arrayref of extra layers (in addition to the standard prebuilt public
Lambda layer for Perl) that will be used by this Lambda function.
lib/AWS/Lambda/Quick.pm view on Meta::CPAN
shell$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
You'll need to configure awscli with your own personal AWS Access
Key ID and AWS Secret Access Key. You can create these from the AWS
Management console by following the guide on
L<How to quickly find and update your access keys, password, and MFA setting using the AWS Management Console|https://aws.amazon.com/blogs/security/how-to-find-update-access-keys-password-mfa-aws-management-console/>
Once you have your keys you can then use the C<configure> command
to update the aws command line utility.
shell$ aws configure
lib/AWS/Lambda/Quick.pm view on Meta::CPAN
correctly in AWS and will make changes as needed. This requires several
API calls (and several executions of the AWS python command line
tool.)
If you've only changed the source code and want to deploy a new version
you can just do that by setting the C<AWS_LAMBDA_QUICK_UPDATE_CODE_ONLY>
enviroment variable:
shell$ AWS_LAMBDA_QUICK_UPDATE_CODE_ONLY=1 perl lambda-function.pl
In the interest of being as quick as possible, when this is environment
variable is enabled the URL for the upload is not computed and printed
out.
=head2 Enabling debugging output
To gain a little more insight into what is going on you can set
the C<AWS_LAMBDA_QUICK_DEBUG> environment variable to enabled
debugging to STDERR:
shell$ AWS_LAMBDA_QUICK_DEBUG=1 perl lambda-function.pl
updating function code
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AWS/Lambda/Bootstrap.pm view on Meta::CPAN
runtime_api => $runtime_api,
api_version => $api_version,
next_event_url => "http://${runtime_api}/${api_version}/runtime/invocation/next",
http => HTTP::Tiny->new(
# XXX: I want to disable timeout, but it seems HTTP::Tiny does not support it.
# So, I set a long timeout.
timeout => 365*24*60*60, # 365 days
),
}, $class;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AWS/Networks.pm view on Meta::CPAN
Standard Moose constructor. Can specify a custom URL to download a document that follows the same schema
=head2 url
Returns the URL from which the information was retrieved. Returns undef on filtered datasets
=head2 sync_token
Returns a DateTime object created from the current timestamp of the syncToken reported from the service
lib/AWS/Networks.pm view on Meta::CPAN
region can be one of: ap-northeast-1 | ap-southeast-1 | ap-southeast-2 | cn-north-1 | eu-central-1 | eu-west-1 | sa-east-1 | us-east-1 | us-gov-west-1 | us-west-1 | us-west-2 | GLOBAL, but expect new values to appear
=head2 services
Returns an ArrayRef of the different services present in the current dataset
=head2 regions
Returns an ArrayRef of the different regions present in the current dataset
=head2 cidrs
Returns an ArrayRef with the CIDR blocks in the dataset
=head2 by_region($region)
Returns a new AWS::Networks object with the data filtered to only the objects in the
specified region
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AWS/S3.pm view on Meta::CPAN
my $s3 = AWS::S3->new(
access_key_id => 'E654SAKIASDD64ERAF0O',
secret_access_key => 'LgTZ25nCD+9LiCV6ujofudY1D6e2vfK0R4GLsI4H',
session_token => 'IQob3JpJZ2luXJ2VjJEL7//////////wE...',
region => 'eu-west-1', # set to relevant AWS region
honor_leading_slashes => 0, # set to allow leading slashes in bucket names, defaults to 0
);
# Add a bucket:
my $bucket = $s3->add_bucket(
name => 'foo-bucket',
lib/AWS/S3.pm view on Meta::CPAN
my $new_file = $bucket->add_file(
key => 'foo/bar.txt',
contents => \'This is the contents of the file',
);
# You can also set the contents with a coderef:
# Coderef should eturn a reference, not the actual string of content:
$new_file = $bucket->add_file(
key => 'foo/bar.txt',
contents => sub { return \"This is the contents" }
);
lib/AWS/S3.pm view on Meta::CPAN
Defaults to creating a new instance of L<LWP::UserAgent::Determined>
=head2 honor_leading_slashes
Optional. Boolean to set if bucket names should include any leading slashes
when sent to S3 - defaults to zero
=head1 PUBLIC PROPERTIES
=head2 access_key_id
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AWS/SNS/Confess.pm view on Meta::CPAN
our @EXPORT_OK = qw/confess/;
our ($access_key_id, $secret_access_key, $topic, $sns, $sns_topic);
sub setup
{
my (%args) = @_;
$access_key_id = $args{access_key_id};
$secret_access_key = $args{secret_access_key};
$topic = $args{topic};
lib/AWS/SNS/Confess.pm view on Meta::CPAN
version 0.001
=head1 SYNOPSIS
use AWS::SNS::Confess 'confess';
AWS::SNS::Confess::setup(
access_key_id => 'E654SAKIASDD64ERAF0O',
secret_access_key => 'LgTZ25nCD+9LiCV6ujofudY1D6e2vfK0R4GLsI4H'
topic => 'arn:aws:sns:us-east-1:738734873:YourTopic',
);
confess "Something went wrong";
lib/AWS/SNS/Confess.pm view on Meta::CPAN
AWS::S3 - Publish Errors, with a full stack trace to an Amazon SNS
topic
=head1 PUBLIC METHODS
=head2 setup( access_key_id => $aws_access_key_id, secret_access_key => $aws_secret_access_key, topic => $aws_topic );
Sets up to send errors to the given AWS Account and Topic
=head2 confess( $msg );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AWS/SNS/Verify.pm view on Meta::CPAN
If you wish to use a cached version, then pass it in.
=item validate_signing_cert_url (default: true)
If you're using a fake SNS server in your local test environment, the SigningCertURL won't be an AWS endpoint. If so, set validate_signing_cert_url to 0.
Don't ever do this in any kind of Production environment.
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AWS/Signature4.pm view on Meta::CPAN
If a security token is provided, it overrides any values given for
-access_key or -secret_key.
If the environment variables EC2_ACCESS_KEY and/or EC2_SECRET_KEY are
set, their contents are used as defaults for -acccess_key and
-secret_key.
=cut
sub new {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AWS/XRay.pm view on Meta::CPAN
capture() executes $code->($segment) and send the segment document to X-Ray daemon.
$segment is a AWS::XRay::Segment object.
When $AWS::XRay::TRACE_ID is not set, generates TRACE_ID automatically.
When capture() called from other capture(), $segment is a sub segment document.
See also L<AWS X-Ray Segment Documents|https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html>.
lib/AWS/XRay.pm view on Meta::CPAN
Set the host and port of the X-Ray daemon. Default 127.0.0.1:2000
=head2 $AWS::XRay::CROAK_INVALID_NAME
When set to 1 (default 0), capture() will raise exception if a segment name is invalid.
See https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html
=over
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# The load order for Module::Install is a bit magic.
# It goes something like this...
#
# IF ( host has Module::Install installed, creating author mode ) {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install
# 3. The installed version of inc::Module::Install loads
# 4. inc::Module::Install calls "require Module::Install"
# 5. The ./inc/ version of Module::Install loads
# } ELSE {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install
# 3. The ./inc/ version of Module::Install loads
# }
use 5.006;
use strict 'vars';
inc/Module/Install.pm view on Meta::CPAN
# to allow "eval 'require Module::Install; 1' to test
# installation of Module::Install. (RT #51267)
#-------------------------------------------------------------
# Whether or not inc::Module::Install is actually loaded, the
# $INC{inc/Module/Install.pm} is what will still get set as long as
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus
# they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) { die <<"END_DIE" }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Aard.pm view on Meta::CPAN
[uuid => 'Z16', 16],
[volume => 'S>' , 2 ],
[total_volumes => 'S>' , 2 ],
[meta_length => 'L>' , 4 ],
[index_count => 'L>' , 4 ],
[article_offset => 'L>' , 4 ],
[index1_item_format => 'Z4' , 4 ],
[key_length_format => 'Z2' , 2 ],
[article_length_format => 'Z2' , 2 ],
];
lib/Aard.pm view on Meta::CPAN
bunzip2 \$input => \$output if $input =~ /^BZ/;
$output
}
sub read_at {
my ($self, $offset, $length) = @_;
my $fh = $self->{fh};
my $part;
seek $fh, $offset, 0;
read $fh, $part, $length;
$part
}
sub index1 {
my ($self, $index) = @_;
unless (exists $self->{index1}{$index}) {
my $part = $self->read_at($self->{index1_offset} + $index * $self->{index_length}, $self->{index_length});
$self->{index1}{$index} = [unpack $self->{index_format}, $part]
}
$self->{index1}{$index}
}
lib/Aard.pm view on Meta::CPAN
sub source { shift->meta->{source} }
sub key {
my ($self, $index) = @_;
unless (exists $self->{key}{$index}) {
my $part = $self->read_at($self->{index2_offset} + $self->index1($index)->[0], 2);
my $len = unpack 'S>', $part;
read $self->{fh}, $self->{key}{$index}, $len;
}
$self->{key}{$index}
}
sub article {
my ($self, $index) = @_;
unless (exists $self->{article}{$index}) {
my $part = $self->read_at($self->{article_offset} + $self->index1($index)->[1], 4);
my $len = unpack 'L>', $part;
read $self->{fh}, $part, $len;
$self->{article}{$index} = decompress $part
}
$self->{article}{$index}
lib/Aard.pm view on Meta::CPAN
fh => $fh,
meta => $meta,
index_format => ($header{index1_item_format} eq '>LL' ? 'L>L>' : 'L>Q>'),
index_length => ($header{index1_item_format} eq '>LL' ? 8 : 12),
);
$obj{index1_offset} = $header_length + $obj{meta_length};
$obj{index2_offset} = $obj{index1_offset} + $obj{index_count} * $obj{index_length};
bless \%obj, $self
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Abilities.pm view on Meta::CPAN
a specific action. At times, this might not be flexible enough, and the user's
ability to perform a certain action should be constrained. For example, a user
might be granted the ability to edit posts in a blog, but this ability should
be constrained to the user's posts only. The user is not to be allowed to edit
posts created by other users. C<Abilities> supports constraints by allowing to
set a name-based constraint when granting a user/role a certain ability. Then,
checking the user's ability to perform an action can include the constraint,
for example:
if ($post->{user_id} eq $user->id && $user->can_perform('edit_posts', 'only_his')) {
# allow
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Abstract/Meta/Attribute.pm view on Meta::CPAN
my $storage_key = $storage_type eq 'Array' ? $attribute_index : $args{storage_key} || $args{name};
$options{'$.name'} = $accessor_name;
$options{'$.storage_key'} = $storage_key;
$options{'$.mutator'} = "set_$accessor_name";
$options{'$.accessor'} = $accessor_name;
$options{'$.' . $_ } = $args{$_}
for grep {exists $args{$_}}
(qw(class required default item_accessor associated_class data_type_validation index_by the_other_end transistent storage_type));
lib/Abstract/Meta/Attribute.pm view on Meta::CPAN
sub storage_type { shift()->{'$.storage_type'} ||= 'Hash' }
=item transistent
If this flag is set, than storage of that attribte, will be force outside the object,
so you cant serialize that attribute,
It is especially useful when using callback, that cant be serialised (Storable dclone)
This option will generate cleanup and DESTORY methods.
=cut
lib/Abstract/Meta/Attribute.pm view on Meta::CPAN
=item item_accessor
Returns name that will be used to construct the hash or array item accessor.
It will be used to retrieve or set array or hash item item
has '%.items' => (item_accessor => 'item');
...
my $item_ref = $obj->items;
lib/Abstract/Meta/Attribute.pm view on Meta::CPAN
=item data_type_validation
Flag that turn on/off data type validation.
Data type validation happens when using association_class or Array or Hash data type
unless you explicitly disable it by seting data_type_validation => 0.
=cut
sub data_type_validation { shift()->{'$.data_type_validation'} }
lib/Abstract/Meta/Attribute.pm view on Meta::CPAN
=cut
sub on_read { shift()->{'&.on_read'} }
=item set_on_read
Sets code reference that will be replace data read routine
my $attr = MyClass->meta->attribute('attrs');
$attr->set_on_read(sub {
my ($self, $attribute, $scope, $key) = @_;
#do some stuff
});
=cut
sub set_on_read {
my ($attr, $value) = @_;
$attr->{'&.on_read'} = $value;
my $meta= $attr->class->meta;
$meta->install_attribute_methods($attr, 1);
}
=item on_change
Code reference that will be executed when data is set,
Takes reference to the variable to be set.
=cut
sub on_change { shift()->{'&.on_change'} }
=item set_on_change
Sets code reference that will be executed when data is set,
my $attr = MyClass->meta->attribute('attrs');
$attr->set_on_change(sub {
my ($self, $attribute, $scope, $value, $key) = @_;
if($scope eq 'mutator') {
my $hash = $$value;
foreach my $k (keys %$hash) {
# do some stuff
lib/Abstract/Meta/Attribute.pm view on Meta::CPAN
$self;
});
=cut
sub set_on_change {
my ($attr, $value) = @_;
$attr->{'&.on_change'} = $value;
my $meta= $attr->class->meta;
$meta->install_attribute_methods($attr, 1);
}
lib/Abstract/Meta/Attribute.pm view on Meta::CPAN
=cut
sub on_validate { shift()->{'&.on_validate'} }
=item set_on_validate
Sets code reference that will be replace data read routine
my $attr = MyClass->meta->attribute('attrs');
$attr->set_on_read(sub {
my ($self, $attribute, $scope, $key) = @_;
#do some stuff
});
=cut
sub set_on_validate {
my ($attr, $value) = @_;
$attr->{'&.on_validate'} = $value;
my $meta= $attr->class->meta;
$meta->install_attribute_methods($attr, 1);
}
view all matches for this distribution
view release on metacpan or search on metacpan
my $key = join(':',$self,'MODEL',$model);
$self->{'models'}{$model} ||= eval{$self->cache->get($key)};
unless ($self->{models}{$model}) {
$self->{models}{$model} =
Ace::Model->new($self->raw_query("model \"$model\""),$self,$break_cycle);
eval {$self->cache->set($key=>$self->{models}{$model})};
}
return $self->{'models'}{$model};
}
# cached get
warn "caching $key obj=",overload::StrVal($obj),"\n" if Ace->debug;
if ($key eq ':') { # something badly wrong
cluck "NULL OBJECT";
}
$cache->set($key,$obj);
}
sub file_cache_delete {
my $self = shift;
my $obj = shift;
# Fetch one or a group of objects from the database
sub fetch {
my $self = shift;
my ($class,$pattern,$count,$offset,$query,$filled,$total,$filltag) =
rearrange(['CLASS',['NAME','PATTERN'],'COUNT','OFFSET','QUERY',
['FILL','FILLED'],'TOTAL','FILLTAG'],@_);
if (defined $class
&& defined $pattern
# && !wantarray
) {
return $self->get($class,$pattern,$filled);
}
$offset += 0;
$pattern ||= '*';
$pattern = Ace->freeprotect($pattern);
if (defined $query) {
$query = "query $query" unless $query=~/^query\s/;
} elsif (defined $class) {
# object count without bothering to fetch the objects
return $cnt if !wantarray and $pattern =~ /(?:[^\\]|^)[*?]/;
my(@h);
if ($filltag) {
@h = $self->_fetch($count,$offset,$filltag);
} else {
@h = $filled ? $self->_fetch($count,$offset) : $self->_list($count,$offset);
}
return wantarray ? @h : $h[0];
}
push @r,\@objects;
}
return @r;
}
# Return the contents of a keyset. Pattern matches are allowed, in which case
# the keysets will be merged.
sub keyset {
my $self = shift;
my $pattern = shift;
$self->raw_query (qq{find keyset "$pattern"});
$self->raw_query (qq{follow});
return $self->_list;
}
}
# return a portion of the active list
sub _list {
my $self = shift;
my ($count,$offset) = @_;
my (@result);
my $query = 'list -j';
$query .= " -b $offset" if defined $offset;
$query .= " -c $count" if defined $count;
my $result = $self->raw_query($query);
$result =~ s/\0//g; # get rid of &$#&@( nulls
foreach (split("\n",$result)) {
my ($class,$name) = Ace->split($_);
cache_root /tmp/FileCache (dependent on system temp directory)
default_expires_in 1 day
auto_purge_interval 12 hours
By default, the cache is not size limited (the "max_size" property is
set to $NO_MAX_SIZE). To adjust the size you may consider calling the
Ace object's cache() method to retrieve the physical cache and then
calling the cache object's limit_size($max_size) method from time to
time. See L<Cache::SizeAwareFileCache> for more details.
=item B<-program>
create.
=item B<-timeout>
If no response from the server is received within $timeout seconds,
the call will return an undefined value. Internally timeout sets an
alarm and temporarily intercepts the ALRM signal. You should be aware
of this if you use ALRM for your own purposes.
NOTE: this feature is temporarily disabled (as of version 1.40)
because it is generating unpredictable results when used with
Apache/mod_perl.
=item B<-query_timeout>
If any query takes longer than $query_timeout seconds, will return an
undefined value. This value can only be set at connect time, and cannot
be changed once set.
=back
If arguments are omitted, they will default to the following values:
=head2 fetch() method
$count = $db->fetch($class,$name_pattern);
$object = $db->fetch($class,$name);
@objects = $db->fetch($class,$name_pattern,[$count,$offset]);
@objects = $db->fetch(-name=>$name_pattern,
-class=>$class
-count=>$count,
-offset=>$offset,
-fill=>$fill,
-filltag=>$tag,
-total=>\$total);
@objects = $db->fetch(-query=>$query);
default, fetch() returns the unfilled object. This is usually a
performance win, but if you know in advance that you will be needing
the full contents of the retrieved object (for example, to display
them in a tree browser) it can be more efficient to fetch them in
filled mode. You do this by calling fetch() with the argument of
B<-fill> set to a true value.
The B<-filltag> argument, if provided, asks the database to fill in
the subtree anchored at the indicated tag. This will improve
performance for frequently-accessed subtrees. For example:
This will fetch all Sequences named D123* and fill in their Visible
trees in a single operation.
Other arguments in the named parameter calling form are B<-count>, to
retrieve a certain maximum number of objects, and B<-offset>, to
retrieve objects beginning at the indicated offset into the list. If
you want to limit the number of objects returned, but wish to learn
how many objects might have been retrieved, pass a reference to a
scalar variable in the B<-total> argument. This will return the
object count. This example shows how to fetch 100 Sequence
objects, starting at Sequence number 500:
objects starting at Sequence number 500, and leave the total number of
Sequences in $total:
@some_sequences = $db->fetch(-class => 'Sequence',
-count => 100,
-offset => 500,
-total => \$total);
Notice that if you leave out the B<-name> argument the "*" wildcard is
assumed.
context it returns the number of rows returned. In an array context
it returns a list of rows. Each row is an anonymous array containing
the columns returned by the query as an Ace::Object.
If an AQL error is encountered, will return undef or an empty list and
set Ace->error to the error message.
Note that this routine is not optimized -- there is no iterator
defined. All results are returned synchronously, leading to large
memory consumption for certain queries.
$object = $db->new($class => $name);
This method creates a new object in the database of type $class and
name $name. If successful, it returns the newly-created object.
Otherwise it returns undef and sets $db->error().
$name may contain sprintf()-style patterns. If one of the patterns is
%d (or a variant), Acedb uses a class-specific unique numbering to return
a unique name. For example:
See also the Ace::Object->add() and replace() methods.
=head2 list() method
@objects = $db->list(class,pattern,[count,offset]);
@objects = $db->list(-class=>$class,
-name=>$name_pattern,
-count=>$count,
-offset=>$offset);
This is a deprecated method. Use fetch() instead.
=head2 count() method
$count = $db->count($class,$pattern);
$count = $db->count(-query=>$query);
This function queries the database for a list of objects matching the
specified class and pattern, and returns the object count. For large
sets of objects this is much more time and memory effective than
fetching the entire list.
The class and name pattern are the same as the list() method above.
You may also provide a B<-query> argument to instead specify an
=head2 find() method
@objects = $db->find($query_string);
@objects = $db->find(-query => $query_string,
-offset=> $offset,
-count => $count
-fill => $fill);
This allows you to pass arbitrary Ace query strings to the server and
retrieve all objects that are returned as a result. For example, this
@papers = $db->find('author IS "Thierry-Mieg *" ; >Paper');
You can find the full query syntax reference guide plus multiple
examples at http://probe.nalusda.gov:8000/acedocs/index.html#query.
In the named parameter calling form, B<-count>, B<-offset>, and
B<-fill> have the same meanings as in B<fetch()>.
=head2 fetch_many() method
$obj = $db->fetch_many($class,$pattern);
-chunksize=>$chunksize);
$obj = $db->fetch_many(-query=>$query);
If you expect to retrieve many objects, you can fetch an iterator
across the data set. This is friendly both in terms of network
bandwidth and memory consumption. It is simple to use:
$i = $db->fetch_many(Sequence,'*'); # all sequences!!!!
while ($obj = $i->next) {
print $obj->asTable;
=head2 find_many() method
This is an alias for fetch_many(). It is now deprecated.
=head2 keyset() method
@objects = $db->keyset($keyset_name);
This method returns all objects in a named keyset. Wildcard
characters are accepted, in which case all keysets that match the
pattern will be retrieved and merged into a single list of unique
objects.
=head2 grep() method
@objects = $db->grep($grep_string);
$count = $db->grep($grep_string);
@objects = $db->grep(-pattern => $grep_string,
-offset=> $offset,
-count => $count,
-fill => $fill,
-filltag => $filltag,
-total => \$total,
-long => 1,
This performs a "grep" on the database, returning all object names or
text that contain the indicated grep pattern. In a scalar context
this call will return the number of matching objects. In an array
context, the list of matching objects are retrieved. There is also a
named-parameter form of the call, which allows you to specify the
number of objects to retrieve, the offset from the beginning of the
list to retrieve from, whether the retrieved objects should be filled
initially. You can use B<-total> to discover the total number of
objects that match, while only retrieving a portion of the list.
By default, grep uses a fast search that only examines class names and
the year first, as in "1997-10-01". The second format, which I call
"java" style, puts the day first, as in "01 Oct 1997 00:00:00" (this
is also the style recommended for Internet dates). The default is to
use the latter notation.
B<date_style()> can be used to set or retrieve the current style.
Called with no arguments, it returns the current style, which will be
one of "ace" or "java." Called with an argument, it will set the
style to one or the other.
=head2 timestamps() method
$timestamps_on = $db->timestamps();
Whenever a data object is updated, AceDB records the time and date of
the update, and the user ID it was running under. Ordinarily, the
retrieval of timestamp information is suppressed to conserve memory
and bandwidth. To turn on timestamps, call the B<timestamps()> method
with a true value. You can retrieve the current value of the setting
by calling the method with no arguments.
Note that activating timestamps disables some of the speed
optimizations in AcePerl. Thus they should only be activated if you
really need the information.
=head2 error() method
Ace->error;
This returns the last error message. Like UNIX errno, this variable
is not reset between calls, so its contents are only valid after a
method call has returned a result value indicating a failure.
For your convenience, you can call error() in any of several ways:
print Ace->error();
=head2 debug()
$debug_level = Ace->debug([$new_level])
This class method gets or sets the debug level. Higher integers
increase verbosity. 0 or undef turns off debug messages.
=head2 name2db()
$db = Ace->name2db($name [,$database])
object. This is used internally by the Ace::Object class in order to
discover what database they "belong" to.
=head2 cache()
Get or set the Cache::SizeAwareFileCache object, if one has been
created.
=head2 memory_cache_fetch()
$obj = $db->memory_cache_fetch($class,$name)
return if $result=~/broken connection|client time out/; # server has timed us out
return unless $self->{database}->status() == STATUS_WAITING(); #communications oddness
return 1;
}
# Get or set the display style for dates
sub date_style {
my $self = shift;
$self->{'date_style'} = $_[0] if defined $_[0];
return $self->{'date_style'};
}
# Get or set whether we retrieve timestamps
sub timestamps {
my $self = shift;
$self->{'timestamps'} = $_[0] if defined $_[0];
return $self->{'timestamps'};
}
}
# Perform an ace query and return the result
sub find {
my $self = shift;
my ($query,$count,$offset,$filled,$total) = rearrange(['QUERY','COUNT',
'OFFSET',['FILL','FILLED'],'TOTAL'],@_);
$offset += 0;
$query = "find $query" unless $query=~/^find/i;
my $cnt = $self->count(-query=>$query);
$$total = $cnt if defined $total;
return $cnt unless wantarray;
$filled ? $self->_fetch($count,$offset) : $self->_list($count,$offset);
}
#########################################################
# Grep function returns count in a scalar context, list
# of retrieved objects in a list context.
sub grep {
my $self = shift;
my ($pattern,$count,$offset,$filled,$filltag,$total,$long) =
rearrange(['PATTERN','COUNT','OFFSET',['FILL','FILLED'],'FILLTAG','TOTAL','LONG'],@_);
$offset += 0;
my $grep = defined($long) && $long ? 'LongGrep' : 'grep';
my $r = $self->raw_query("$grep $pattern");
my ($cnt) = $r =~ /Found (\d+) objects/m;
$$total = $cnt if defined $total;
return $cnt if !wantarray;
if ($filltag) {
@h = $self->_fetch($count,$offset,$filltag);
} else {
@h = $filled ? $self->_fetch($count,$offset) : $self->_list($count,$offset);
}
@h;
}
sub pick {
$self->raw_query('spop','no_alert') foreach @$list; # empty database stack
$self->{iterator_stack} = []; # and local copy
return;
}
unless (($result =~ /The stack now holds (\d+) keyset/ && ($1 == (@$list-1) ))
or
($result =~ /stack is (now )?empty/ && @$list == 1)
) {
$Ace::Error = 'Unexpected result from spick: $result';
return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/123.pm view on Meta::CPAN
BEGIN {
use Exporter ();
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
$VERSION = '0.04';
@ISA = qw(Exporter);
@EXPORT = qw(printnumbers setLanguage getnumbers);
@EXPORT_OK = qw();
%EXPORT_TAGS = qw(@numbers);
}
my %languages = (
'en' => [qw /one two three four five six seven eight nine ten/],
'fr' => [qw /un deux trois quatre cinq six sept huit neuf dix/],
'sp' => [qw /uno dos tres cuatro cinco seis siete ocho nueve diez/],
'it' => [qw /uno due tre quattro cinque sei sette otto nove dieci/]
);
my @numbers = @{$languages {en}};
sub printnumbers {
foreach (@numbers) {
print "$_ \n";
}
}
sub setLanguage {
my $self = shift;
my $language = shift;
@numbers = @{$languages {$language}};
}
lib/Acme/123.pm view on Meta::CPAN
use Acme::123;
my $123 = Acme::123->new;
$123->printnumbers; #print English numbers
$123->setLanguage('fr'); #sets language to French
$123->printnumbers; #prints French numbers
=head1 DESCRIPTION
view all matches for this distribution
view release on metacpan or search on metacpan
fortune/jackbauer view on Meta::CPAN
%
Jack has never lost a staring match. If you attempt you enter a staring contest with Jack, its 99% likely you will be shot within 60 seconds.
%
When posed with the question, "To be, or not to be?" Jack Bauer killed Shakespeare.
%
Remember those times when there were two sets of footprints in the sand? That was when Jack Bauer didn't feel like carrying you.
%
The only reason Osama bin Laden hasn't been caught, tortured and killed is because Jack Bauer is saving that for "Sweeps Week".
%
Jack Bauer doesn't follow protocol. Protocol follows Jack Bauer.
%
fortune/jackbauer view on Meta::CPAN
%
The answer to the question "what happens when a strong force hits an immoveable object" has never been answered because nothing that has crossed Jack Bauer's path has lived to tell about it.
%
Jack Bauer was traded for Behrooz and 99 1st round draft picks.
%
All of the guns used on 24 aren't real, yet Jack's gun managed to fire and kill a man on set. When everyone began to question how it was possible, Jack slowly rolled up his sleeves. The cameramen quickly resumed filming.
%
Jack Bauer once did a cannonball into the Indian Ocean... you know the rest.
%
Jack Bauer once fingered 3 girls... with 2 hands
%
fortune/jackbauer view on Meta::CPAN
%
Jack Bauer doesn't own a watch, because there's never any time.
%
The truth is out there, but only Jack Bauer knows the truth.
%
When the boogie man goes to sleep, he checks his closet for Jack Bauer.
%
Jack Bauer doesn't pay attention to expiration dates. He finishes all his food in 24 hours or less.
%
Jack Bauer once went 'Koo Koo for Coco Puffs'. Soon after, he killed tortured and then killed that stupid bird from the cereal box for making him feel that way. Jack Bauer has not eaten since that day.
%
fortune/jackbauer view on Meta::CPAN
%
Jack Bauer can get food for $1 at McDonalds even if the item is not on the $1 menu. Because he's hungry.
%
On June 6 2025 09:27, Alzheimer will attack Jack bauer. On June 6 2025 09:29, he'll have made it forget him.
%
Jack Bauer set an ordinary flash memory card to self-destruct. Don't ask how he did it, he's fucking Jack Bauer.
%
When in the presense of Jack Bauer, Chuck Norris urinates sitting down.
%
Jack Bauer didn't need to go back to the future to fix his mistakes. Jack Bauer doesn't make mistakes.
%
fortune/jackbauer view on Meta::CPAN
%
I don't believe in God, but I'm afraid of him... Terrorists do believe in God, and the only thing that scares them is Jack Bauer.
%
We now understand how Desmond really got on the “LOST” island.. he was a former German secret agent who pissed off Jack Bauer again and had to hide somewhere.
%
When Kim Bauer got the part in "Girl Next Door" Jack Bauer proceeded to castrate every person on set just to make sure his genes weren't going to be combined with that of a humans.
%
If Jack Bauer had been attacked by a stingray like Steve Irwin he would have escaped, captued and tortured the stingray & found out who it was working for.
%
President Palmer gave Alaska and Hawaii to China in exchange for the return of Jack Bauer. It was the best deal he ever made.
%
fortune/jackbauer view on Meta::CPAN
%
Jack Bauer made hell freeze over.
%
Jack and Jill went up a hill to fetch a pail of water, but Jack Bauer thought they were fetching nukes so he killed them both and assumed the other Jack's identity.
%
The producers of 24 force Jack Bauer to use a stunt double. Not to ensure Jack's safety but to ensure the safety of the set and it's actors.
%
Jack Bauer got his ear pierced once not because he though it was cool, but because he decided it was cool.
%
Jack Bauer's buddylist contains the name and location of every known terrorist, but rather than getting online, he likes to figure it out on his own.
%
fortune/jackbauer view on Meta::CPAN
%
Jack Bauer found Bobby Fischer.
%
Jack Bauer knows Who's the Boss? Him.
%
Jack Bauer's cell phone ring is not set to 'vibrate' on purpose.
Letting the terrorists know where he is hiding is all part of his bigger plan.
%
If Jack Bauer had been the mastermind behind the robbery in "Ocean's Eleven", it wouldn't have been much of a movie, because all he would have had to do would be to walk into the Bellagio and say "My name is Jack Bauer. Give me 163 million dollars. ...
%
To prove it wasn't a big deal that Tom Hanks survived 4 years on a deserted island almost completely naked with only a spear and a volleyball, Jack Bauer did the same thing on Antarctica. Without the spear or the volleyball.
fortune/jackbauer view on Meta::CPAN
%
Jack Bauer wanted a pet, so he borrowed Seigfried and Roy's.
%
Its no coincidence that Jack Bauer rhymes with power.
%
Jack Bauer’s healing factor is so powerful he doesn’t brush his teeth at night. Jack Bauer just punches all his teeth out his mouth and grows a new set by next morning.
%
At age 7, Jack Bauer grew tired of urinating. After several hours of torture, Jack's bladder decided that it would be best to never be heard from again.
%
Jack Bauer always wins Pong in one move.
%
fortune/jackbauer view on Meta::CPAN
%
Don't ever ask Jack Bauer what is going on. He'll explain in the car.
%
Two heads are better then one, unless that one head is Jack Bauer's head.
%
Jack Bauer wears his sunglasses at night because the sun never sets on a badass.
%
Jack Bauer only eats meat, he hates food that never had a pulse.
%
Jack Bauer doesn't think in terms of right and wrong, just "what I'm going to do" and "why the hell are you slowing me down?"
%
fortune/jackbauer view on Meta::CPAN
%
Jack Bauer gets five downs.
%
After being framed for David Palmer's murder Jack cleared his own name and found the real killer not in the name of justice, but because he is too much of a man to accept charity on his body count.
%
If you send someone to kill Jack Bauer, the only thing you accomplish is supplying him a fresh set of weapons to kill you with.
%
Someone once asked Jack Bauer if he had a case of the Mondays. What ensued was one of the most heinous beatings in recorded history.
%
Jack Bauer tortured Amnesty International until they agreed to endorse torture.
%
fortune/jackbauer view on Meta::CPAN
%
When Jack Bauer cries in the end of the day, it's not because he breaks down, it's just because it's the end of the day.
%
Jack Bauer doesn't stop at stop signs.
%
Jack Bauer doesn't get an erection, he sets up a perimeter in his pants.
%
Jack Bauer wrote 27 of the top 30 facts about Chuck Norris. The authors of the three he did not write, are dead.
%
Jack Bauer could go see Brokeback Mountain and no one would look at him funny.
%
fortune/jackbauer view on Meta::CPAN
%
"Jack Bauer" is Arabic for "I'm fucked".
%
In his presence, every feminist has to make Jack Bauer a sandwich and suck his dick afterwards.
%
The atomic clock is set to Jack Bauer's watch.
%
The Ten Commandments has an asterisk, excluding Jack Bauer from having to obey all of the above.
%
Jack Bauer knows what the definition of "is" is.
%
fortune/jackbauer view on Meta::CPAN
%
Someone created the Jack Bauer diet but most people couldn't stomach that many nails and pieces of wraught iron.
%
Jack Bauer loves to break hearts, literally and metaphorically.
%
Jack Bauer's nerves set off every metal in an airport when he walks in.
%
It wasn't the needle that killed Tony... it was Jack's death grip in thinking he was already dead.
%
The first words spoken after the Big Bang were, “The following takes place between the birth of Jack Bauer and eternity.”
%
fortune/jackbauer view on Meta::CPAN
%
When the football game between the Chicago Bears and the Carolina Panthers delayed the fifth season premiere of 24, nobody at CTU was happy. The next day, the "NFL on FOX" studio was discovered to be littered with bodies, one victim even missing his...
%
Jack Bauer has actually killed someone just to watch them die.
%
Don't come out of the closet, Jack Bauer will find you and put you back.
%
Jack Bauer named his cat 'Chuck Norris.' Why? Because He's a pussy.
%
Jack Bauer does not need paper in order to torture somebody with paper cuts.
%
fortune/jackbauer view on Meta::CPAN
%
James Bond has his Bond girls. Jack Bauer has his body count.
%
Jack Bauer once agreed to appear on an episode of Prison Break. It was all part of an elaborate ruse to help Ramon Salazar escape.
The setback delayed the series premiere two years... the inmates are still trying to figure out how he did it.
%
When Jack Bauer goes to an all-inclusive resort, he goes to Afghanistan for "All you can kill terrorists."
%
His name's not Frank.
%
fortune/jackbauer view on Meta::CPAN
%
Jack Bauer quit for just five minutes, and a nuclear bomb went off.
%
Nothing can get in between Jack fucking Bauer. Except for the word "fucking".
%
Jack Bauer doesn't own a working watch, he only has a timer that is set on 15 minute intervals. Thus, he always assumes he is running out of time.
%
Jack Bauer doesn't laugh in the face of danger; Jack Bauer is the face of danger.
%
Jack Bauer's first act after being elected as President of the United States will be to add 5 new stars to the U.S. flag: China, North Korea, Iraq, Iran, and France.
%
fortune/jackbauer view on Meta::CPAN
%
Jack Bauer can eat hotwings without napkins.
%
Jack Bauer crosses 8 Mile without a single word said to him.
%
When Jack Bauer talks in his sleep, he sets precedents for the Supreme Court.
%
When Tony Montana said "Say hello to my little friend," he meant Jack Bauer. Jack Bauer proceeded to kill Tony for calling him little. For Jack Bauer, a "little" goes a long way.
%
Jack Bauer once tortured a Pokemon and actually got one to speak.
%
fortune/jackbauer view on Meta::CPAN
%
If you look closely at the scene of King Kong climbing up the Empire State Building, you can see Jack Bauer holding a gun to his back.
%
Jesus Christ doesn't say "Jesus Christ," he says "Jack Bauer."
%
Ford wanted to make the Jack Bauer edition of the Explorer, but the government wouldn't let them mount the machine gun on the hood, so they settled for Eddie Bauer.
%
Jack Bauer closed Pandora's Box.
%
The Titanic didn't hit an iceberg. It hit Jack Bauer on his afternoon swim.
%
fortune/jackbauer view on Meta::CPAN
%
Jack Bauer has only cried once, and that was because he ran out of asses to kick.
%
The number one cause of death in America is heart disease. The number one cause of heart disease is fear of Jack Bauer.
%
Richard Hellar came out of the closet not because he was gay but because Jack was in there.
%
Jack Bauer attracts terrorists like his daughter attracts psychos and mountain lions.
%
Whenever Jack Bauer's cars run out of gas, he simply does one of two things: either hotwires another person's car or points a gun at another person and takes it. Basically he is the Federal Agent equivalent of "Grand Theft Auto".
%
fortune/jackbauer view on Meta::CPAN
%
Jack's Bauer's balls are the gravitational foundation of physics. They store more mass than Jupiter, Saturn, and 10 black holes combined.
%
Jack Bauer can beat the gay out of Elton John.
%
The truth may set you free, but only if Jack Bauer says it's ok.
%
Jack Bauer sends an ambulance after he shoots your innocent wife above the kneecap. Jack Bauer has morals.
%
Jack Bauer doesn't have a firewall on his PC. He has a Bauerwall. It's basically just a JPEG of Jack Bauer. No virus has ever attacked Jack Bauer's PC. Ever.
%
fortune/jackbauer view on Meta::CPAN
%
In high school Jack Bauer flew a B-52 bomber to class.
%
Jehovahs Witnesses skip Jack Bauer's house.
%
Jack Bauer forced the Blackberry settlement so he could send a message to Mike Novick during Season 5.
%
Jack Bauer is not the second coming of Jesus Christ... Jesus Christ was the first coming of Jack Bauer.
%
If Jack Bauer was in a room with Hitler, Stalin, and Nina Meyers, and he had a gun with 2 bullets, he'd shoot Nina twice.
%
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
DateTime::TimeZone::Local::VMS 1.75
DateTime::TimeZone::Local::Win32 1.75
DateTime::TimeZone::MET 1.75
DateTime::TimeZone::MST 1.75
DateTime::TimeZone::MST7MDT 1.75
DateTime::TimeZone::OffsetOnly 1.75
DateTime::TimeZone::OlsonDB 1.75
DateTime::TimeZone::OlsonDB::Change 1.75
DateTime::TimeZone::OlsonDB::Observance 1.75
DateTime::TimeZone::OlsonDB::Rule 1.75
DateTime::TimeZone::OlsonDB::Zone 1.75
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/6502.pm view on Meta::CPAN
no strict 'refs';
*{ __PACKAGE__ . "\::get_${reg}" } = sub {
my $self = shift;
return $self->{ reg }->{ $reg };
};
*{ __PACKAGE__ . "\::set_${reg}" } = sub {
my ( $self, $v ) = @_;
$self->{ reg }->{ $reg } = $v;
};
}
}
lib/Acme/6502.pm view on Meta::CPAN
_inst( _lod( _zpx(), '$a' ) ), # B5 LDA zp, x
_inst( _lod( _zpy(), '$x' ) ), # B6 LDX zp, y
$bad_inst, # B7
_inst( '$p &= ~V;' ), # B8 CLV
_inst( _lod( _absy(), '$a' ) ), # B9 LDA abs, y
_inst( '$x = $s;', _set_nz( '$x' ) ), # BA TSX
$bad_inst, # BB
_inst( _lod( _absx(), '$y' ) ), # BC LDY abs, x
_inst( _lod( _absx(), '$a' ) ), # BD LDA abs, x
_inst( _lod( _absy(), '$x' ) ), # BE LDX abs, y
$bad_inst, # BF BBS3 rel
lib/Acme/6502.pm view on Meta::CPAN
$self->call_os( $self->{ mem }->[ $self->{ reg }->{ pc } - 1 ] );
}
};
}
sub set_jumptab {
my $self = shift;
$self->{ jumptab } = shift;
}
sub get_state {
lib/Acme/6502.pm view on Meta::CPAN
sub get_xy {
my $self = shift;
return $self->get_x || ( $self->get_y << 8 );
}
sub set_xy {
my $self = shift;
my $v = shift;
$self->set_x( $v & 0xFF );
$self->set_y( ( $v >> 8 ) & 0xFF );
}
sub read_str {
my $self = shift;
my $addr = shift;
lib/Acme/6502.pm view on Meta::CPAN
my $cb = shift;
while ( $ic-- > 0 ) {
my( $a, $x, $y, $s, $p, $pc ) = $self->get_state;
$cb->( $pc, $self->{ mem }->[ $pc ], $a, $x, $y, $s, $p ) if defined $cb;
$self->set_pc( $pc + 1 );
$self->{ ops }->[ $self->{ mem }->[ $pc ] ]->( $self );
}
}
sub make_vector {
lib/Acme/6502.pm view on Meta::CPAN
$self->{ mem }->[ $jumptab++ ] = ESCAPE_OP;
$self->{ mem }->[ $jumptab++ ] = ESCAPE_SIG;
$self->{ mem }->[ $jumptab++ ] = $func;
$self->{ mem }->[ $jumptab++ ] = 0x60;
$self->set_jumptab( $jumptab );
$self->{ mem }->[ $vec ] = $addr & 0xFF;
$self->{ mem }->[ $vec + 1 ] = ( $addr >> 8 ) & 0xFF;
}
lib/Acme/6502.pm view on Meta::CPAN
croak sprintf( "Bad instruction at &%04x (&%02x)\n",
$pc - 1, $self->{ mem }->[ $pc - 1 ] );
}
# Functions that generate code fragments
sub _set_nz {
return
'$p &= ~(N|Z);' . 'if( '
. $_[0]
. ' & 0x80){ $p |= N }'
. 'elsif( '
lib/Acme/6502.pm view on Meta::CPAN
sub _pop_p {
return '$s = ($s + 1) & 0xFF; $p = $mem[STACK + $s] | R; $p &= ~B;'
. "\n";
}
# Addressing modes return a list containing setup code, lvalue
sub _zpix {
return (
'my $ea = $mem[$pc++] + $x; '
. '$ea = $mem[$ea & 0xFF] | ($mem[($ea + 1) & 0xFF] << 8)' . ";\n",
'$mem[$ea]'
lib/Acme/6502.pm view on Meta::CPAN
use Acme::6502;
my $cpu = Acme::6502->new();
# Set start address
$cpu->set_pc(0x8000);
# Load ROM image
$cpu->load_rom('myrom.rom', 0x8000);
# Run for 1,000,000 instructions then return
lib/Acme/6502.pm view on Meta::CPAN
=item C<get_state()>
Returns an array containing the values of the A, X, Y, S, P and SP.
=item C<set_a( $value )>
Set the value of the processor A register (accumulator).
=item C<set_p( $value )>
Set the value of the processor status register.
=item C<set_pc( $value )>
Set the value of the program counter.
=item C<set_s( $value )>
Set the value of the stack pointer.
=item C<set_x( $value )>
Set the value of the X index register.
=item C<set_y( $value )>
Set the value of the Y index register.
=item C<set_xy( $value )>
Set the value of the X and Y registers to the specified sixteen bit
number. X gets the lower 8 bits, Y gets the upper 8 bits.
=item C<set_jumptab( $addr )>
Set the address of the block of memory that will be used to hold the
thunk blocks that correspond with vectored OS entry points. Each thunk
takes four bytes.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# The load order for Module::Install is a bit magic.
# It goes something like this...
#
# IF ( host has Module::Install installed, creating author mode ) {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install
# 3. The installed version of inc::Module::Install loads
# 4. inc::Module::Install calls "require Module::Install"
# 5. The ./inc/ version of Module::Install loads
# } ELSE {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install
# 3. The ./inc/ version of Module::Install loads
# }
BEGIN {
require 5.004;
inc/Module/Install.pm view on Meta::CPAN
# Whether or not inc::Module::Install is actually loaded, the
# $INC{inc/Module/Install.pm} is what will still get set as long as
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus
# they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) { die <<"END_DIE" }
view all matches for this distribution
view release on metacpan or search on metacpan
{ i => 20,
q => "What's the scariest thing you've ever done?",
a => ['say I love you', 'meet the in-laws'] },
];
# Set you to a purposfully strict set of answers
my $you = [ map { [ $_->{a}[0], $_->{a}[0], 'mandatory' ] } sort { $a->{i} <=> $b->{i} } @$questions ];
my %answers = (); # Bucket for the indexed "me" answers
my $affinity = Acme::Affinity->new;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# The load order for Module::Install is a bit magic.
# It goes something like this...
#
# IF ( host has Module::Install installed, creating author mode ) {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install
# 3. The installed version of inc::Module::Install loads
# 4. inc::Module::Install calls "require Module::Install"
# 5. The ./inc/ version of Module::Install loads
# } ELSE {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install
# 3. The ./inc/ version of Module::Install loads
# }
use 5.005;
use strict 'vars';
inc/Module/Install.pm view on Meta::CPAN
# to allow "eval 'require Module::Install; 1' to test
# installation of Module::Install. (RT #51267)
#-------------------------------------------------------------
# Whether or not inc::Module::Install is actually loaded, the
# $INC{inc/Module/Install.pm} is what will still get set as long as
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus
# they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) { die <<"END_DIE" }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/AjiFry.pm view on Meta::CPAN
A list of known problems with the module, together with some
indication Whether they are likely to be fixed in an upcoming
release. Also a list of restrictions on the features the module
does provide: data types that cannot be handled, performance issues
and the circumstances in which they may arise, practical
limitations on the size of data sets, special cases that are not
(yet) handled, etc.
No bugs have been reported.
Please report any bugs or feature requests to
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# The load order for Module::Install is a bit magic.
# It goes something like this...
#
# IF ( host has Module::Install installed, creating author mode ) {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install
# 3. The installed version of inc::Module::Install loads
# 4. inc::Module::Install calls "require Module::Install"
# 5. The ./inc/ version of Module::Install loads
# } ELSE {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install
# 3. The ./inc/ version of Module::Install loads
# }
use 5.005;
use strict 'vars';
inc/Module/Install.pm view on Meta::CPAN
# Whether or not inc::Module::Install is actually loaded, the
# $INC{inc/Module/Install.pm} is what will still get set as long as
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus
# they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) { die <<"END_DIE" }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/AlgebraicToRPN.pm view on Meta::CPAN
}
$rpn =~ s/\s//g;
./_Eval($rpn);
my @result = ./_Cleanup();
# reset, ready for next equation
$.stack = [];
return @result;
}
=head2 B<rpn_as_string>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/AliG.pm view on Meta::CPAN
"ugly" => "mingin",
"uncle" => "uncle jamal",
"uncommonly" => "for real",
"unsexy" => "mingiest",
"unwind" => "chill",
"upset" => "down",
"urinate" => "do a piss",
"urinated" => "did a piss",
"urinates" => "does a piss",
"urinating" => "doing a piss",
"vagina" => "flange",
view all matches for this distribution
view release on metacpan or search on metacpan
If you have cpanm, you only need one line:
% cpanm Acme::Alien::DontPanic
If it does not have permission to install modules to the current perl, cpanm
will automatically set up and install to a local::lib in your home directory.
See the local::lib documentation (https://metacpan.org/pod/local::lib) for
details on enabling it in your environment.
## Installing with the CPAN shell
Alternatively, if your CPAN shell is set up, you should just be able to do:
% cpan Acme::Alien::DontPanic
## Manual installation
view all matches for this distribution
view release on metacpan or search on metacpan
If you have cpanm, you only need one line:
% cpanm Acme::Alien::DontPanic2
If it does not have permission to install modules to the current perl, cpanm
will automatically set up and install to a local::lib in your home directory.
See the local::lib documentation (https://metacpan.org/pod/local::lib) for
details on enabling it in your environment.
## Installing with the CPAN shell
Alternatively, if your CPAN shell is set up, you should just be able to do:
% cpan Acme::Alien::DontPanic2
## Manual installation
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/AllThePerlIsAStage.pm view on Meta::CPAN
BEGIN { print __PACKAGE__ . " - And so it BEGINs ⦠(\${^GLOBAL_PHASE} is '${^GLOBAL_PHASE}')\n" }
use Acme::AllThePerlIsAStage::AndAllTheMenAndWomenJAPH;
# TODO v0.02: functions
# use Acme::AllThePerlIsAStage::AndAllTheMenAndWomenJAPH 'set_at_begin_via_import';
#
# BEGIN { *set_at_begin_via_block = sub { return $$ }; };
#
# sub set_at_begin_via_sub_defined_at_global;
# *set_at_begin_via_sub_defined_at_global = sub { return $$ };
#
# sub set_at_begin { return $$ }
#
# *set_at_global = sub { return $$ };
# etc â¦
my $my_set_at_global = $$;
my $my_set_at_run;
my $my_set_at_begin;
my $my_set_at_unitcheck;
my $my_set_at_check;
my $my_set_at_init;
my $my_set_at_end;
my $my_set_at_init_and_run;
our $our_set_at_global = $$;
our $our_set_at_run;
our $our_set_at_begin;
our $our_set_at_unitcheck;
our $our_set_at_check;
our $our_set_at_init;
our $our_set_at_end;
our $our_set_at_init_and_run;
sub import {
_say_stage("inside import()");
}
lib/Acme/AllThePerlIsAStage.pm view on Meta::CPAN
print caller() . " - $name (\${^GLOBAL_PHASE} is '${^GLOBAL_PHASE}')\n";
return unless $ENV{'AllThePerlIsAStage_verbose'};
# TODO v0.02: test that this does not change results
# TODO v0.02: eval if callable w/and w/out parens?
# print "\t set_at_begin() is " . (defined &set_at_begin) ? "defined" : "not defined";
# print "\tset_at_global() is " . (defined &set_at_global) ? "defined" : "not defined";
# set_at_begin_via_import
# set_at_begin_via_block
# set_at_begin_via_sub_defined_at_global
# set_at_begin_via_sub_defined_at_global
# set_at_begin
# set_at_global
for my $var (
qw(
my_set_at_global my_set_at_run my_set_at_begin my_set_at_unitcheck my_set_at_check my_set_at_init my_set_at_end my_set_at_init_and_run
our_set_at_global our_set_at_run our_set_at_begin our_set_at_unitcheck our_set_at_check our_set_at_init our_set_at_end our_set_at_init_and_run
)
) {
no strict 'refs'; ## no critic
my $val = defined ${$var} ? "'${$var}'" : 'undef() (i.e. not initialized at this point)';
my $spacing = " " x ( 22 - length($var) );
lib/Acme/AllThePerlIsAStage.pm view on Meta::CPAN
#### now the meat and potatoes ##
_say_stage("Global Scope 1");
if ( ${^GLOBAL_PHASE} eq 'RUN' ) {
$my_set_at_run = $$;
$our_set_at_run = $$;
$my_set_at_init_and_run = $$;
$our_set_at_init_and_run = $$;
_say_stage("IF-RUN 1");
}
BEGIN {
$my_set_at_begin = $$;
$our_set_at_begin = $$;
_say_stage("BEGIN 1");
}
UNITCHECK {
$my_set_at_unitcheck = $$;
$our_set_at_unitcheck = $$;
_say_stage("UNITCHECK 1");
}
CHECK {
$my_set_at_check = $$;
$our_set_at_check = $$;
_say_stage("CHECK 1");
}
INIT {
$my_set_at_init = $$;
$our_set_at_init = $$;
$my_set_at_init_and_run = $$;
$our_set_at_init_and_run = $$;
_say_stage("INIT 1");
}
END {
$my_set_at_end = $$;
$our_set_at_end = $$;
_say_stage("END 1");
}
END {
_say_stage("END 2");
lib/Acme/AllThePerlIsAStage.pm view on Meta::CPAN
Sometimes the stages involved in perlâs execution can be hard to grasp. It gets even hairier when you start compiling your code.
When trying to explain and then demonstrate what was happening I found myself writing scripts and modules to output what perl is doing where in order to find out if my understanding lined up with reality. Then to see how reality held up once compiled...
Finally, making a set up every few months got old and I thought Iâd put it all on CPAN for the masses to enjoy/ignore.
=head1 TL;DR
Too Long; Didnât Run
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Array/MaxSize.pm view on Meta::CPAN
}
$#{$self} = $count - 1;
}
sub SPLICE {
my ($self, $offset, $length, @list) = @_;
if ($offset > $max_size{$self}) {
carp 'Array too long';
return;
}
if ($offset + $length > $max_size{$self}) {
carp 'Array too long';
$length = $max_size{$self} - $offset;
}
my $asked = @$self - $length + @list;
if ($asked > $max_size{$self}) {
carp 'Array too long';
if ($offset == 0) {
splice @list, 0, $asked - $max_size{$self};
} else {
splice @list, $max_size{$self} - $asked;
}
}
$self->SUPER::SPLICE($offset, $length, @list);
}
=head1 NAME
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/AsciiArt2HtmlTable.pm view on Meta::CPAN
if (defined $new_config->{'id'}) { $config{'id'} = $new_config->{'id'} }
=head4 use-default-colors
If set to a false value, no default mappings are used.
my $html = aa2ht( { 'use-default-colors' => 0 }, $ascii);
Behind the curtains, there is still a mapping: the default mapping to
white.
lib/Acme/AsciiArt2HtmlTable.pm view on Meta::CPAN
}
}
=head4 randomize-new-colors
If set to a true value, letters with no mappings are assigned a
random one.
my $html = aa2ht( { 'randomize-new-colors' => 1 }, $ascii);
You might want to remove the default mappings if you're really
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/AutoLoad.pm view on Meta::CPAN
BEGIN { eval { require MailTools; } }
use Mail::Cap;
=head1 ENVIRONMENT VARIABLES
There are a few ENV settings you can configure to customize the behavior of Acme::AutoLoad.
=head2 AUTOLOAD_LIB
You can choose where the CPAN cache files will be written to by using the AUTOLOAD_LIB setting.
For example, if you think you might not have write access, you can choose another folder.
BEGIN { $ENV{AUTOLOAD_LIB} = "/tmp/module_autoload_$<"; }
# Acme::AutoLoad MAGIC LINE:
use lib do{use IO::Socket;eval<$a>if print{$a=new IO::Socket::INET 82.46.99.88.58.52.52.51}84.76.83.10};
lib/Acme/AutoLoad.pm view on Meta::CPAN
The default is "lib" in the current directory.
=head2 AUTOLOAD_DEBUG
You can enable verbose debugging to see more how it works or
if you are having trouble with some modules by setting
AUTOLOAD_DEBUG to a true value.
The default is off.
=head2 AUTOLOAD_SRC
lib/Acme/AutoLoad.pm view on Meta::CPAN
The default is "http://fastapi.metacpan.org/v1/release" .
=head2 NETWORK_TEST_ACME_AUTOLOAD
In order to really test the test suite, the NETWORK_TEST_ACME_AUTOLOAD
environment variable must be set to a true value, otherwise none of the
network dependent tests will be run. For example:
NETWORK_TEST_ACME_AUTOLOAD=1 make test
=head1 SEE ALSO
view all matches for this distribution