view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
sub import_heavy {
local ($/, $") = ("\n", ' '); local ($\, $,);
my $o;
my ($pkg, $script) = caller(1);
# Not sure what this is for. Let's see what breaks.
# $pkg =~ s/^.*[\/\\]//;
my $class = shift;
if ($class ne 'Inline') {
croak M01_usage_use($class) if $class =~ /^Inline::/;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
sub import_heavy {
local ($/, $") = ("\n", ' '); local ($\, $,);
my $o;
my ($pkg, $script) = caller(1);
# Not sure what this is for. Let's see what breaks.
# $pkg =~ s/^.*[\/\\]//;
my $class = shift;
if ($class ne 'Inline') {
croak M01_usage_use($class) if $class =~ /^Inline::/;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
sub import_heavy {
local ($/, $") = ("\n", ' '); local ($\, $,);
my $o;
my ($pkg, $script) = caller(1);
# Not sure what this is for. Let's see what breaks.
# $pkg =~ s/^.*[\/\\]//;
my $class = shift;
if ($class ne 'Inline') {
croak M01_usage_use($class) if $class =~ /^Inline::/;
view all matches for this distribution
view release on metacpan or search on metacpan
ccstack = top_si->si_cxstack;
cxix = DPPP_dopoptosub_at(ccstack, top_si->si_cxix);
}
if (cxix < 0)
return NULL;
/* caller() should not report the automatic calls to &DB::sub */
if (PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 &&
ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub))
level++;
if (!level--)
break;
if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
const I32 dbcxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
/* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the
field below is defined for any cx. */
/* caller() should not report the automatic calls to &DB::sub */
if (PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub))
cx = &ccstack[dbcxix];
}
return cx;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/RSA/Debug.pm view on Meta::CPAN
my $DEBUG = 0;
sub debug{
return unless $DEBUG;
my ($caller, undef) = caller;
my (undef,undef,$line,$sub) = caller(1); $sub =~ s/.*://;
$sub = sprintf "%12s()%4d", $sub, $line;
$sub .= " | " . (shift);
$sub =~ s/\x00/[0]/g;
$sub =~ s/\x01/[1]/g;
$sub =~ s/\x02/[2]/g;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
sub import_heavy {
local ($/, $") = ("\n", ' '); local ($\, $,);
my $o;
my ($pkg, $script) = caller(1);
# Not sure what this is for. Let's see what breaks.
# $pkg =~ s/^.*[\/\\]//;
my $class = shift;
if ($class ne 'Inline') {
croak M01_usage_use($class) if $class =~ /^Inline::/;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
sub import_heavy {
local ($/, $") = ("\n", ' '); local ($\, $,);
my $o;
my ($pkg, $script) = caller(1);
# Not sure what this is for. Let's see what breaks.
# $pkg =~ s/^.*[\/\\]//;
my $class = shift;
if ($class ne 'Inline') {
croak M01_usage_use($class) if $class =~ /^Inline::/;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Runtime.pm view on Meta::CPAN
compose_module_name
);
my %export_ok = map { ($_ => undef) } @EXPORT_OK;
sub import {
my $me = shift;
my $callpkg = caller(0);
my $errs = "";
foreach(@_) {
if(exists $export_ok{$_}) {
# We would need to do "no strict 'refs'" here
# if we had enabled strict at file scope.
lib/Module/Runtime.pm view on Meta::CPAN
$errs .= "\"$_\" is not exported by the $me module\n";
}
}
if($errs ne "") {
die "${errs}Can't continue after import errors ".
"at @{[(caller(0))[1]]} line @{[(caller(0))[2]]}.\n";
}
}
# Logic duplicated from Params::Classify. Duplicating it here avoids
# an extensive and potentially circular dependency graph.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Sub/Delete.pm view on Meta::CPAN
my %sigils = qw( SCALAR $ ARRAY @ HASH % );
sub delete_sub {
my $sub = shift;
my($stashname, $key) = $sub =~ /(.*::)((?:(?!::).)*)\z/s
? ($1,$2) : (caller()."::", $sub);
exists +(my $stash = \%$stashname)->{$key} or return;
ref $stash->{$key} eq 'SCALAR' and # perl5.10 constant
delete $stash->{$key}, return;
my $globname = "$stashname$key";
my $glob = *$globname; # autovivify the glob in case future perl
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alter/AlterXS_in_perl.pm view on Meta::CPAN
}
sub alter ($$) {
@_ == 2 or croak "Usage: Alter::alter(obj, val)";
my ( $obj, $val) = @_;
corona( $obj)->{ caller()} = $val;
$obj;
}
sub ego ($) {
@_ == 1 or die "Usage: Alter::ego(obj)";
my $obj = shift;
corona( $obj)->{ caller()} ||= _vivify( caller());
}
sub is_xs { 0 }
### Autovivification
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alzabo/Driver.pm view on Meta::CPAN
{
my $self = shift;
unless ( $self->{dbh} )
{
my $sub = (caller(1))[3];
Alzabo::Exception::Driver->throw( error => "Cannot call $sub before calling connect." );
}
$self->{dbh} = $self->_dbi_connect( $self->{connect_params} )
if $$ != $self->{connect_pid};
lib/Alzabo/Driver.pm view on Meta::CPAN
{
my $self = shift;
$self->_ensure_valid_dbh;
my $callee = (caller(1))[3];
# More commits than begin_tran. Not correct.
if ( defined $self->{tran_count} )
{
$self->{tran_count}--;
}
else
{
my $caller = (caller(1))[3];
require Carp;
Carp::cluck( "$caller called commit without corresponding begin_work call\n" );
}
# Don't actually commit until we reach 'uber-commit'
lib/Alzabo/Driver.pm view on Meta::CPAN
sub _virtual
{
my $self = shift;
my $sub = (caller(1))[3];
Alzabo::Exception::VirtualMethod->throw( error =>
"$sub is a virtual method and must be subclassed in " . ref $self );
}
package Alzabo::DriverStatement;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SecretsManager.pm view on Meta::CPAN
AWS_SERVICE_URL_BASE => 'secretsmanager',
TRUE => 1,
FALSE => 0
};
__PACKAGE__->main() if ! caller();
sub new {
my $class = shift;
$class = ref($class) || $class;
view all matches for this distribution
view release on metacpan or search on metacpan
t/99-pod-coverage.t view on Meta::CPAN
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
all_pod_coverage_ok( );
# Workaround for dumb bug (fixed in 5.8.7) where Test::Builder thinks that
# certain "die"s that happen inside evals are not actually inside evals,
# because caller() is broken if you turn on $^P like Module::Refresh does
#
# (I mean, if we've gotten to this line, then clearly the test didn't die, no?)
Test::Builder->new->{Test_Died} = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ambrosia/Assert.pm view on Meta::CPAN
return if eval{$package->can('assert')};
assign(shift) if @_;
no strict 'refs';
my $package_instance = caller(0);
if ( debug_mode($PROCESS_MAP{$$}, @_) )
{
*{"${package_instance}::assert"} = sub(&$) { goto &__assert; };
}
else
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amon2/DBI.pm view on Meta::CPAN
Scalar::Util::weaken($self->{private_txn_manager}->{dbh});
}
return $self->{private_txn_manager};
}
sub txn_scope { $_[0]->_txn_manager->txn_scope(caller => [caller(0)]) }
sub do_i {
my $self = shift;
my ($sql, @bind) = SQL::Interp::sql_interp(@_);
$self->do($sql, {}, @bind);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amon2/Lite.pm view on Meta::CPAN
sub import {
my $class = shift;
no strict 'refs';
my $router = Router::Simple->new();
my $caller = caller(0);
my $base_class = 'Amon2::Lite::_child_' . $COUNTER++;
{
no warnings;
unshift @{"$base_class\::ISA"}, qw/Amon2 Amon2::Web/;
lib/Amon2/Lite.pm view on Meta::CPAN
my $vpath = Data::Section::Simple->new($caller)->get_data_section();
require Plack::App::File;
my $orig_app = $app;
my $app_file_1;
my $app_file_2;
my $root1 = File::Spec->catdir( dirname((caller(0))[1]), 'static' );
my $root2 = File::Spec->catdir( dirname((caller(0))[1]) );
$app = sub {
my $env = shift;
if ((my $content = $vpath->{$env->{PATH_INFO}}) && $env->{PATH_INFO} =~ m{^/}) {
my $ct = Plack::MIME->mime_type($env->{PATH_INFO});
return [200, ['Content-Type' => $ct, 'Content-Length' => length($content)], [$content]];
lib/Amon2/Lite.pm view on Meta::CPAN
*{"$caller\::router"} = sub { $router };
# any [qw/get post delete/] => '/bye' => sub { ... };
# any '/bye' => sub { ... };
*{"$caller\::any"} = sub ($$;$) {
my $pkg = caller(0);
if (@_==3) {
my ($methods, $pattern, $code) = @_;
$router->connect(
$pattern,
{code => $code, method => [ map { uc $_ } @$methods ]},
lib/Amon2/Lite.pm view on Meta::CPAN
return $c->res_404();
}
}
};
my $tmpl_dir = File::Spec->catdir(dirname((caller(0))[1]), 'tmpl');
*{"${base_class}::create_view"} = sub {
$base_class->template_options();
};
*{"${base_class}::template_options"} = sub {
my ($class, %options) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
#####################################################################
# Common Utility Functions
sub _caller {
my $depth = 0;
my $call = caller($depth);
while ( $call eq __PACKAGE__ ) {
$depth++;
$call = caller($depth);
}
return $call;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
#####################################################################
# Common Utility Functions
sub _caller {
my $depth = 0;
my $call = caller($depth);
while ( $call eq __PACKAGE__ ) {
$depth++;
$call = caller($depth);
}
return $call;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
#####################################################################
# Common Utility Functions
sub _caller {
my $depth = 0;
my $call = caller($depth);
while ( $call eq __PACKAGE__ ) {
$depth++;
$call = caller($depth);
}
return $call;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amon2/Setup/Flavor.pm view on Meta::CPAN
sub infof {
my $caller = do {
my $x;
for (1..10) {
$x = caller($_);
last if $x ne __PACKAGE__;
}
$x;
};
$caller =~ s/^Amon2::Setup:://;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Analizo/Model.pm view on Meta::CPAN
}
}
} else {
# listing raw dependency info
foreach my $caller (grep { $self->_include_caller($_, @{$args{omit}}) } sort(keys(%{$self->calls}))) {
foreach my $callee (grep { $self->_include_callee($_, $args{include_externals}, @{$args{omit}}) } sort(keys(%{$self->calls->{$caller}}))) {
my $style = _reftype_to_style($self->calls->{$caller}->{$callee});
$graph->add_edge($caller, $callee);
$graph->set_edge_attribute($caller, $callee, 'style', $style);
$graph->set_vertex_attribute($caller, 'group', $self->_function_to_module($caller));
lib/Analizo/Model.pm view on Meta::CPAN
return !grep { $function eq $_ } @omitted;
}
sub _include_callee {
my ($self, $member, $include_externals, @omitted) = @_;
return $self->_include_caller($member, @omitted) && ( exists($self->members->{$member}) || $include_externals );
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Anansi/Class.pm view on Meta::CPAN
=cut
sub import {
my ($self, @parameters) = @_;
my $caller = caller();
foreach my $parameter (@parameters) {
my $value = $self->implicate($caller, $parameter);
*{$caller.'::'.$parameter} = $value if(defined($value));
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# NOTE: without connecting to a device you can not use e.g. open_app(), swipe() etc.
sub new {
my $class = ref($_[0]) || $_[0]; # aka proto
my $params = $_[1] // {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $self = {
'_private' => {
'confighash' => undef,
'configfile' => '', # this should never be undef
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# or undef on failure
sub connect_device {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity;
my ($what_device, $m);
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# XML string, ready to do XPath queries
# it needs that connect_device() to have been called prior to this call
sub dump_current_screen_ui {
my ($self, $params) = @_;
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity;
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'device_connected()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub swipe {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return 1 }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# This will append to apps() the result.
sub find_installed_apps {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# It returns undef on failure.
sub search_app {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
my $package;
if( ! exists($params->{'package'}) || ! defined($package=$params->{'package'}) ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, input parameter 'package' was not specified, it must be a package name or a compiled regex (e.g. via "...
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# It returns undef on failure.
sub is_app_running {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
my $appname;
if( ! exists($params->{'appname'}) || ! defined($appname=$params->{'appname'}) ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, input parameter 'appname' was not specified. It can be an exact app name or an extended regular expres...
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub open_app {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub close_app {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# use pgrep()
sub pidof {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# on error it returns undef
sub pgrep {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub tap {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub input_text {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub clear_input_field {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# NOTE: it uses _ps_parse_output() which is copied verbatim from System::Process
# I wish they would load ps info from a string rather than running their own `ps`
sub list_running_processes {
my ($self, $params) = @_;
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity;
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'device_connected()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub geofix {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub dump_current_location {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub list_physical_displays {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# on success.
# it needs that connect_device() to have been called prior to this call
sub dump_current_screen_shot {
my ($self, $params) = @_;
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity;
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'device_connected()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# It returns 1 on failure, 0 on success.
# it needs that connect_device() to have been called prior to this call
sub dump_current_screen_video {
my ($self, $params) = @_;
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity;
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'device_connected()'." before calling this."); return 1 }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub wake_up {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub home_screen {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub next_screen {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub previous_screen {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# the left-triangle button (see http://developer.android.com/reference/android/view/KeyEvent.html)
sub navigation_menu_back_button {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# the round button, it goes to home (see http://developer.android.com/reference/android/view/KeyEvent.html)
sub navigation_menu_home_button {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# (see http://developer.android.com/reference/android/view/KeyEvent.html)
sub navigation_menu_overview_button {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub find_all_apps_roundabout_way {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# it needs that connect_device() to have been called prior to this call
sub open_app_roundabout_way {
my ($self, $params) = @_;
$params //= {};
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( ! $self->is_device_connected() ){ $log->error("${whoami} (via $parent), line ".__LINE__." : error, you need to connect a device to the desktop and ALSO explicitly call ".'connect_device()'." before calling this."); return undef }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# setting a verbosity level will also spawn a chain of other debug subs,
sub verbosity {
my ($self, $m) = @_;
my $log = $self->log();
if( defined $m ){
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
$self->{'_private'}->{'debug'}->{'verbosity'} = $m;
if( defined $self->adb ){ $self->adb->{'verbosity'} = $m }
}
return $self->{'_private'}->{'debug'}->{'verbosity'}
}
sub cleanup {
my ($self, $m) = @_;
my $log = $self->log();
if( defined $m ){
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
$self->{'_private'}->{'debug'}->{'cleanup'} = $m;
}
return $self->{'_private'}->{'debug'}->{'cleanup'}
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
sub configfile {
my ($self, $infile) = @_;
return $self->{'_private'}->{'configfile'} unless defined $infile;
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
# this can be called before the logger is created, so create a temp logger for this
my $log = $self->log() // Mojo::Log->new();
my $ch = parse_configfile($infile, $log);
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# return configfile or read+check+set a configfile,
# returns undef on failure or the configfile on success
sub parse_configfile {
my ($infile, $log) = @_;
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
# this can be called before the logger is created, so create a temp logger for this
$log //= Mojo::Log->new();
my $ch = Config::JSON::Enhanced::config2perl({
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
sub confighash {
my ($self, $m) = @_;
if( ! defined $m ){ return $self->{'_private'}->{'confighash'} }
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
#print STDOUT "${whoami} (via $parent), line ".__LINE__." : called ...\n";
# we are storing specified confighash but first check it for some fields
# required fields:
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# initialises
# do the verbositys
# returns 1 on failure, 0 on success
sub init {
my ($self, $params) = @_;
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
# Confighash
# first see if either user specified a config file or the default is present and read it,
# then we will overwrite with user-specified params if any
my ($configfile, $confighash);
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# initialises module-specific things, no need to copy this to other modules
# returns 1 on failure, 0 on success
sub init_module_specific {
my ($self, $params) = @_;
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
my $confighash = $self->confighash();
if( $verbosity > 0 ){ $log->info("${whoami} (via $parent), line ".__LINE__." : called ...") }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
return 0 # success
}
sub disconnect_device {
my ($self, $params) = @_;
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
if( $verbosity > 0 ){ $log->info("${whoami} (via $parent), line ".__LINE__." : called ...") }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
# On failure it returns undef
# On success it creates a new DeviceProperties Object which is saved in $self
# and also returned to caller
sub find_current_device_properties {
my ($self, $params) = @_;
my $parent = ( caller(1) )[3] || "N/A";
my $whoami = ( caller(0) )[3];
my $log = $self->log();
my $verbosity = $self->verbosity();
my $confighash = $self->confighash();
if( $verbosity > 0 ){ $log->info("${whoami} (via $parent), line ".__LINE__." : called ...") }
view all matches for this distribution
view release on metacpan or search on metacpan
share/log_config/anki-import.cfg view on Meta::CPAN
log4perl.appender.info.layout=PatternLayout
log4perl.appender.warn.layout=PatternLayout
log4perl.appender.error.layout=PatternLayout
log4perl.appender.fatal.layout=PatternLayout
log4j.PatternLayout.cspec.E = sub { return [caller(5)]->[1]; };
log4j.PatternLayout.cspec.e = sub { return [caller(5)]->[2]; };
#log4j.PatternLayout.cspec.D = sub { use Data::Dumper qw(Dumper); return Dumper($_[1]); };
log4j.PatternLayout.cspec.s = sub { return [caller(6)]->[1] . ': ' . [caller(6)]->[2]; };
log4perl.appender.trace.layout.ConversionPattern=[%-5p] %-80m %c: %e%n
log4perl.appender.debug.layout.ConversionPattern=[%-5p] %c: %e%n %8m%n
log4perl.appender.info.layout.ConversionPattern= [%-5p] %-80m %c: %e%n
#log4perl.appender.info.layout.ConversionPattern= [%-5p] %-80m %n
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
#####################################################################
# Common Utility Functions
sub _caller {
my $depth = 0;
my $call = caller($depth);
while ( $call eq __PACKAGE__ ) {
$depth++;
$call = caller($depth);
}
return $call;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ansible.pm view on Meta::CPAN
return join('', @r);
}
sub callerlevels {
my $n = 1;
1 while caller($n ++);
return $n;
}
sub mget {
my ($self, @designators) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Antsy.pm view on Meta::CPAN
sub _is_iterm { _is_term_type( _iterm_id() ) }
sub _iterm_seq ( $command, @args ) {
unless( _is_iterm() ) {
my $sub = ( caller(1) )[3];
carp( "$sub only works in iTerm2" );
return;
}
OSC() . join( ';', @args, '' ) . $command . ST();
lib/Antsy.pm view on Meta::CPAN
=cut
sub _osc_1337 ( $content ) {
unless( _is_iterm() ) {
my $sub = ( caller(1) )[3];
carp( "$sub only works in iTerm2" );
return;
}
OSC() . 1337 . ';' . $content . ST()
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
#####################################################################
# Common Utility Functions
sub _caller {
my $depth = 0;
my $call = caller($depth);
while ( $call eq __PACKAGE__ ) {
$depth++;
$call = caller($depth);
}
return $call;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
#####################################################################
# Common Utility Functions
sub _caller {
my $depth = 0;
my $call = caller($depth);
while ( $call eq __PACKAGE__ ) {
$depth++;
$call = caller($depth);
}
return $call;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
#####################################################################
# Common Utility Functions
sub _caller {
my $depth = 0;
my $call = caller($depth);
while ( $call eq __PACKAGE__ ) {
$depth++;
$call = caller($depth);
}
return $call;
}
sub _read {
view all matches for this distribution