view release on metacpan or search on metacpan
sub ops($) { my $p = shift; my $c = ref $p || $p;
bless $p = {};
use Carp qw(croak);
my $caller = (caller)[0];
my $args = $_[0];
croak "ops takes a hash to pass arguments" unless HASH $args;
foreach (sort keys %$args) {
if (defined $_dflts{$_}) { $p->{$_} = $args->{$_} }
else {
view all matches for this distribution
view release on metacpan or search on metacpan
t/data/lib/Myfile.pm view on Meta::CPAN
use strict;
use warnings;
use Cwd;
sub from_caller { Cwd::realpath(_from_caller()) }
sub _from_caller { (caller)[1] }
sub from_file { Cwd::realpath(__FILE__) }
1;
view all matches for this distribution
view release on metacpan or search on metacpan
PApp/XML.pm view on Meta::CPAN
my $self = shift;
my $dom = shift;
my $temp = bless {
attr => {@_},
}, PApp::XML::Template::;
my $package = (caller)[0];
$temp->{code} = $temp->_dom2sub($dom, $self, $package);
delete $temp->{attr}{special};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PDF/Boxer/Role/SizePosition.pm view on Meta::CPAN
sub move{
my ($self, $x, $y) = @_;
return if
($self->margin_left && $self->margin_left == $x)
&& ($self->margin_top && $self->margin_top == $y);
warn $self->name." move $x, $y from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
$self->adjust({ margin_left => $x, margin_top => $y });
}
sub set_width{
my ($self, $arg) = @_;
return if $self->width && $self->width == $arg;
warn $self->name." set width $arg from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
$self->adjust({ width => $arg });
}
sub set_margin_width{
my ($self, $arg) = @_;
return if $self->margin_width && $self->margin_width == $arg;
warn $self->name." set margin_width $arg from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
$self->adjust({ margin_width => $arg });
}
sub set_height{
my ($self, $arg) = @_;
return if $self->height && $self->height == $arg;
warn $self->name." set height $arg from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
$self->adjust({ height => $arg });
}
sub set_margin_height{
my ($self, $arg) = @_;
return if $self->margin_height && $self->margin_height == $arg;
warn $self->name." set margin_height $arg from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
$self->adjust({ margin_height => $arg });
}
sub set_size{
my ($self, $x, $y) = @_;
return if
($self->width && $self->width == $x)
&& ($self->height && $self->height == $y);
warn $self->name." size $x, $y from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
$self->adjust({ width => $x, height => $y });
}
sub set_margin_size{
my ($self, $x, $y) = @_;
return if $self->margin_width == $x && $self->margin_height == $y;
warn $self->name." size $x, $y from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
$self->adjust({ margin_width => $x, margin_height => $y });
}
sub child_height_set{};
sub child_width_set{};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PDL/Demos.pm view on Meta::CPAN
defined($PERLDL::TERM) ? $PERLDL::TERM->readline($prompt) : ( print $prompt, <> );
}
sub act($) {
local $SIG{__DIE__} = \&Carp::confess;
actnw($_[0], (caller)[0]);
my $prompt = "---- (press enter)";
defined($PERLDL::TERM) ? $PERLDL::TERM->readline($prompt) : ( print $prompt, <> );
}
sub _eval_pkg {
lib/PDL/Demos.pm view on Meta::CPAN
local $SIG{__DIE__} = \&Carp::confess;
my ($script, $pack) = @_;
print "---- Code:";
print $script;
print "---- Output:\n";
_eval_pkg($script, $pack // (caller)[0]);
print "----\n";
print "----\nOOPS!!! Something went wrong, please make a bug report!: $@\n----\n" if $@;
}
my ($searched, @found);
view all matches for this distribution
view release on metacpan or search on metacpan
Basic/SourceFilter/FilterUtilCall.pm view on Meta::CPAN
# and one to an import file.
# --CED 5-Nov-2007
#
sub import {
my ($class) = @_;
($file,$offset) = (caller)[1,2]; # for error reporting
$offset++;
## Parse class name into a regexp suitable for filtration
my $terminator = terminator_regexp($class);
view all matches for this distribution
view release on metacpan or search on metacpan
Demos/Screen.pm view on Meta::CPAN
my $script = $_[0];
$script =~ s/^(\s*)output/$1print/mg;
print "---- Code:";
print $script;
print "---- Output:\n";
my $pack = (caller)[0];
# eval "package $pack; use PDLA; $_[0]";
eval "package $pack; use PDLA; $_[0]";
print "----\nOOPS!!! Something went wrong, please make a bug report!: $@\n----\n" if $@;
my $prompt = "---- (press enter)";
defined($PERLDL::TERM) ? $PERLDL::TERM->readline($prompt) : ( print $prompt, <> );
Demos/Screen.pm view on Meta::CPAN
my $script = $_[0];
$script =~ s/^(\s*)output/$1print/mg;
print "---- Code:";
print $script;
print "---- Output:\n";
my $pack = (caller)[0];
# eval "package $pack; use PDLA; $_[0]";
eval "package $pack; use PDLA; $_[0]";
print "----\n";
print "----\nOOPS!!! Something went wrong, please make a bug report!: $@\n----\n" if $@;
}
view all matches for this distribution
view release on metacpan or search on metacpan
Basic/SourceFilter/FilterUtilCall.pm view on Meta::CPAN
# and one to an import file.
# --CED 5-Nov-2007
#
sub import {
my ($class) = @_;
($file,$offset) = (caller)[1,2]; # for error reporting
$offset++;
## Parse class name into a regexp suitable for filtration
my $terminator = terminator_regexp($class);
view all matches for this distribution
view release on metacpan or search on metacpan
PGP/Pipe.pm view on Meta::CPAN
$args =~ s/%p/$self->{PGPPATH}/g;
$args =~ s/%r/$self->{PGPPATH}\/$self->{Keyring}/g; # PGP::Keyring
$args =~ s/%k/0x$self->{Keyid}/g; # PGP::Key
# Put the file descriptors in the callers package
$fin = (caller)[0] . "::$in";
$fout = (caller)[0] . "::$out";
$ferr = (caller)[0] . "::$err";
Debug ("PGP::Exec=$self->{PGPexec} $baseopts $args");
# just to make sure that PGPPATH is exported!
$ENV{PGPPATH} = $self->{PGPPATH};
view all matches for this distribution
view release on metacpan or search on metacpan
}
# Sends the headers waiting in %PLP::Script::header
sub sendheaders () {
local $\; # reset print behaviour if triggered by say()
$PLP::sentheaders ||= [ caller 1 ? (caller 1)[1, 2] : (caller)[1, 2] ];
print STDOUT "Content-Type: text/plain\n\n" if $PLP::DEBUG & 2;
while (my ($header, $values) = each %PLP::Script::header) {
print STDOUT "$header: $_\n" for split /\n/, $values;
}
print STDOUT "\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PMLTQ/Command.pm view on Meta::CPAN
sub extract_usage {
my $self = shift;
open my $handle, '>', \my $output;
pod2usage( -exitval => 'NOEXIT', -input => (caller)[1], -output => $handle );
$output =~ s/\n$//;
return $output;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/Client/TCPMulti.pm view on Meta::CPAN
sub connect {
my %Options = @_[1..$#_];
$Options{Heap} ||= {};
printf STDERR "!!! -> connect method called from %s:%d\n",
(caller)[1,2] if DEBUG;
my $server = POE::Wheel::SocketFactory->new
( RemoteAddress => $Options{RemoteAddress},
RemotePort => $Options{RemotePort},
lib/POE/Component/Client/TCPMulti.pm view on Meta::CPAN
my $id = $server->ID;
printf TRACE "->connect(count %d, id %d, host (%s:%d) %s:%d);\n",
scalar keys %heap, $id, @Options{qw( RemoteAddress RemotePort )},
(caller)[1,2] if TRACE_CONNECT;
$heap{$id} = bless {
%{ $Options{Heap} },
-ID => $server->ID,
-ADDR => $Options{RemoteAddress},
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/Lightspeed/Hack/Kernel.pm view on Meta::CPAN
} else {
# Enqueue the event for "now", which simulates FIFO in our
# time-ordered queue.
$self->_data_ev_enqueue(
$session, ${ $self->[ KR_ACTIVE_SESSION ] }, $event_name, ET_POST, \@etc,
(caller)[1,2], ${ $self->[ KR_ACTIVE_EVENT ] }, time(),
);
}
# All done!
return 1;
lib/POE/Component/Lightspeed/Hack/Kernel.pm view on Meta::CPAN
# What should we return?
if (wantarray) {
my @return_value = (
($session == ${ $self->[ KR_ACTIVE_SESSION ] })
? $session->_invoke_state(
$session, $event_name, \@etc, (caller)[1,2],
${ $self->[ KR_ACTIVE_EVENT ] }
)
: $self->_dispatch_event(
$session, ${ $self->[ KR_ACTIVE_SESSION ] },
$event_name, ET_CALL, \@etc,
(caller)[1,2], ${ $self->[ KR_ACTIVE_EVENT ] }, time(), -__LINE__
)
);
$! = 0;
return @return_value;
lib/POE/Component/Lightspeed/Hack/Kernel.pm view on Meta::CPAN
if (defined wantarray) {
my $return_value = (
$session == ${ $self->[ KR_ACTIVE_SESSION ] }
? $session->_invoke_state(
$session, $event_name, \@etc, (caller)[1,2],
${ $self->[ KR_ACTIVE_EVENT ] }
)
: $self->_dispatch_event(
$session, ${ $self->[ KR_ACTIVE_SESSION ] },
$event_name, ET_CALL, \@etc,
(caller)[1,2], ${ $self->[ KR_ACTIVE_EVENT ] }, time(), -__LINE__
)
);
$! = 0;
return $return_value;
}
if ($session == ${ $self->[ KR_ACTIVE_SESSION ] }) {
$session->_invoke_state(
$session, $event_name, \@etc, (caller)[1,2],
${ $self->[ KR_ACTIVE_EVENT ] }
);
}
else {
$self->_dispatch_event(
$session, ${ $self->[ KR_ACTIVE_SESSION ] },
$event_name, ET_CALL, \@etc,
(caller)[1,2], ${ $self->[ KR_ACTIVE_EVENT ] }, time(), -__LINE__
);
}
$! = 0;
return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Kernel.pm view on Meta::CPAN
}
$self->_data_ev_enqueue(
$session, $kr_active_session,
EN_SIGNAL, ET_SIGNAL, [ $signal, @etc ],
(caller)[1,2], $kr_active_event
);
return 1;
}
# Public interface for flagging signals as handled. This will replace
lib/POE/Kernel.pm view on Meta::CPAN
# But not if the active event is ET_START, since that would generate
# a CHILD_LOSE without a CHILD_CREATE.
$self->_dispatch_event(
$old_parent, $self,
EN_CHILD, ET_CHILD, [ CHILD_LOSE, $kr_active_session, undef ],
(caller)[1,2], undef, monotime(), -__LINE__
)
unless $kr_active_event_type & ET_START;
# Tell the new parent (kernel) that it's gaining a child.
# (Actually it doesn't care, so we don't do that here, but this is
lib/POE/Kernel.pm view on Meta::CPAN
# Tell the current session that its parentage is changing.
$self->_dispatch_event(
$kr_active_session, $self,
EN_PARENT, ET_PARENT, [ $old_parent, $self ],
(caller)[1,2], undef, monotime(), -__LINE__
);
$self->_data_ses_move_child($kr_active_session->ID, $self->ID);
# Success!
lib/POE/Kernel.pm view on Meta::CPAN
# Tell the current session that the child is departing.
$self->_dispatch_event(
$kr_active_session, $self,
EN_CHILD, ET_CHILD, [ CHILD_LOSE, $child_session, undef ],
(caller)[1,2], undef, monotime(), -__LINE__
);
# Tell the new parent (kernel) that it's gaining a child.
# (Actually it doesn't care, so we don't do that here, but this is
# where the code would go if it ever does in the future.)
# Tell the child session that its parentage is changing.
$self->_dispatch_event(
$child_session, $self,
EN_PARENT, ET_PARENT, [ $kr_active_session, $self ],
(caller)[1,2], undef, monotime(), -__LINE__
);
$self->_data_ses_move_child($child_session->ID, $self->ID);
# Success!
lib/POE/Kernel.pm view on Meta::CPAN
# Enqueue the event for "now", which simulates FIFO in our
# time-ordered queue.
$self->_data_ev_enqueue(
$session, $kr_active_session, $event_name, ET_POST, \@etc,
(caller)[1,2], $kr_active_event
);
return 1;
}
#------------------------------------------------------------------------------
lib/POE/Kernel.pm view on Meta::CPAN
) if exists $poes_own_events{$event_name};
};
$self->_data_ev_enqueue(
$kr_active_session, $kr_active_session, $event_name, ET_POST, \@etc,
(caller)[1,2], $kr_active_event
);
undef;
}
lib/POE/Kernel.pm view on Meta::CPAN
if (wantarray) {
my @return_value = (
($session == $kr_active_session)
? $session->_invoke_state(
$session, $event_name, \@etc, (caller)[1,2],
$kr_active_event
)
: $self->_dispatch_event(
$session, $kr_active_session,
$event_name, ET_CALL, \@etc,
(caller)[1,2], $kr_active_event, monotime(), -__LINE__
)
);
$kr_exception and $self->_rethrow_kr_exception();
lib/POE/Kernel.pm view on Meta::CPAN
if (defined wantarray) {
my $return_value = (
$session == $kr_active_session
? $session->_invoke_state(
$session, $event_name, \@etc, (caller)[1,2],
$kr_active_event
)
: $self->_dispatch_event(
$session, $kr_active_session,
$event_name, ET_CALL, \@etc,
(caller)[1,2], $kr_active_event, monotime(), -__LINE__
)
);
$kr_exception and $self->_rethrow_kr_exception();
lib/POE/Kernel.pm view on Meta::CPAN
return $return_value;
}
if ($session == $kr_active_session) {
$session->_invoke_state(
$session, $event_name, \@etc, (caller)[1,2],
$kr_active_event
);
}
else {
$self->_dispatch_event(
$session, $kr_active_session,
$event_name, ET_CALL, \@etc,
(caller)[1,2], $kr_active_event, monotime(), -__LINE__
);
}
$kr_exception and $self->_rethrow_kr_exception();
lib/POE/Kernel.pm view on Meta::CPAN
# directly is faster than calling alarm_set to enqueue it.
if (defined $time) {
$self->_data_ev_enqueue
( $kr_active_session, $kr_active_session,
$event_name, ET_ALARM, [ @etc ],
(caller)[1,2], $kr_active_event, $time,
);
}
else {
# The event queue has become empty? Stop the time watcher.
$self->loop_pause_time_watcher() unless $kr_queue->get_item_count();
lib/POE/Kernel.pm view on Meta::CPAN
}
$self->_data_ev_enqueue
( $kr_active_session, $kr_active_session,
$event_name, ET_ALARM, [ @etc ],
(caller)[1,2], $kr_active_event, $time,
);
return 0;
}
lib/POE/Kernel.pm view on Meta::CPAN
# Add the new alarm if it includes a time. Calling _data_ev_enqueue
# directly is faster than calling alarm_set to enqueue it.
$self->_data_ev_enqueue
( $kr_active_session, $kr_active_session,
$event_name, ET_ALARM, [ @etc ],
(caller)[1,2], $kr_active_event, undef, $delay, $pri+$delay
);
}
else {
$self->alarm($event_name);
}
lib/POE/Kernel.pm view on Meta::CPAN
}
$self->_data_ev_enqueue
( $kr_active_session, $kr_active_session,
$event_name, ET_ALARM, [ @etc ],
(caller)[1,2], $kr_active_event, undef, $delay, $pri+$delay
);
return 0;
}
lib/POE/Kernel.pm view on Meta::CPAN
) if exists $poes_own_events{$event_name};
}
return $self->_data_ev_enqueue
( $kr_active_session, $kr_active_session, $event_name, ET_ALARM, [ @etc ],
(caller)[1,2], $kr_active_event, $time,
);
}
# Remove an alarm by its ID. TODO Now that alarms and events have
# been recombined, this will remove an event by its ID. However,
lib/POE/Kernel.pm view on Meta::CPAN
return;
}
return $self->_data_ev_enqueue
( $kr_active_session, $kr_active_session, $event_name, ET_ALARM, [ @etc ],
(caller)[1,2], $kr_active_event, $t, $seconds, $pri+$seconds
);
}
# Move a delay to a new offset from time(). As with alarm_adjust(),
# this is optimized internally for this sort of activity.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Params/Clean.pm view on Meta::CPAN
{
my $me=shift; # our package name
my @opts, my $i; push @opts, [$_[$i++]=>$_[$i++]] while $i<@_; # pair up the options (we would use a hash, but we want to preserve order, and anyway we could have the same key repeated)
my %EXPORT=map {$_=>$_} @KEYWORDS; # keywords to be exported (normally all @KEYWORDS) in convenient hash format
my $keys=join "|", @KEYWORDS; # for regex to test for any of our keywords
my $caller=(caller)[0]; # caller's package
# Set up warning/fatal/ignoral categories
$Warn{$caller}={%{$Warn{undef}}}; # start by setting up default warning levels
for (grep $opts[$_][0]=~/^(warn|die|fatal|ignore)$/, 0..$#opts) # grep through the key-halves of each opt for exception-levels
view all matches for this distribution
view release on metacpan or search on metacpan
my $warn;
$SIG{__WARN__} = sub {$warn = shift};
sub t_error {
my($args, $expected_message) = @_;
my $test_name = "[line ".((caller)[2])."]";
(my $expected_error = $expected_message) =~ s/XXX/Error/;
(my $expected_warning = $expected_message) =~ s/XXX/Warning/;
eval { error(@$args) };
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Path/This.pm view on Meta::CPAN
use File::Basename ();
use Sub::Util ();
our $VERSION = '0.005';
sub THISFILE () { Cwd::abs_path((caller)[1]) }
sub THISDIR () {
my $file = (caller)[1];
return -e $file ? File::Basename::dirname(Cwd::abs_path $file) : Cwd::getcwd;
}
sub import {
my $class = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
t/scan/utf8.t view on Meta::CPAN
delete $p->{__P_seen} if exists $p->{__P_seen};
$_[0] };
my $v = $_[0];
my $rv = ref $v;
$dflts = $p->get_dflts((caller)[0]);
my ($depth, $noquote) = (sw(depth), sw(noquote));
if (HASH eq $rv) {
my $params = $v; $v = shift; $rv = ref $v;
$depth = $params->{depth} if exists $params->{depth};
}
t/scan/utf8.t view on Meta::CPAN
sub import {
my ($modname, @args) = @_;
if (@args) {
my @others;
my $caller = (caller)[0];
if (exists $mod_dflts{$caller}) {
$dflts = $mod_dflts{$caller};
} else {
$dflts = undef; # indicate no customization to dflts
}
t/scan/utf8.t view on Meta::CPAN
sub ops($) {
my $p = shift; my $c=ref $p || $p;
bless $p = {}, $c unless ref $p;
my $args = $_[0];
my $ldflts = $p->get_dflts((caller)[0]);
%{$p->{dflts}} = %$dflts unless ref $p->{dflts};
die "ops takes a hash to pass arguments" unless HASH $args;
$ldflts = $p->{dflts};
foreach (sort keys %$args) {
if (exists $ldflts->{$_}) { $ldflts->{$_} = $args->{$_} }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perl/Tidy/Formatter.pm view on Meta::CPAN
}
}
}
}
# enter a list slice, such as '(caller)[1,2]'
my $Kn = $self->K_next_code($Kc);
if ( $Kn && $rLL->[$Kn]->[_TOKEN_] eq '[' ) {
my $seqno_next = $rLL->[$Kn]->[_TYPE_SEQUENCE_];
if ( $seqno_next
&& $self->is_list_by_seqno($seqno_next) )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perl6/Binding.pm view on Meta::CPAN
##==============================================================================
## import - install the filter
##==============================================================================
sub import {
my $caller = (caller)[1];
unless ($INSTALLED{$caller}) {
shift;
filter_add({ @_ });
$INSTALLED{$caller} = 1;
}
lib/Perl6/Binding.pm view on Meta::CPAN
##==============================================================================
## unimport - uninstall the filter
##==============================================================================
sub unimport {
my $caller = (caller)[1];
if ($INSTALLED{$caller}) {
filter_del();
delete $INSTALLED{$caller};
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perl6/Builtins.pm view on Meta::CPAN
with each of the values for these keys being the equivalent item from
the list returned by C<caller> in list context. This is useful because
it means that, instead of:
$subname = (caller)[3];
you can write the much more readable:
$subname = caller->{sub};
view all matches for this distribution
view release on metacpan or search on metacpan
perl5/Pugs-Compiler-Perl6/old/v6.pm view on Meta::CPAN
# invokes the Perl6-to-Perl5 compiler and creates a .pmc file
use strict;
use warnings;
my $filename = (caller)[1];
my $pmc = $filename;
$pmc =~ s/\.(pl|pm|t)$/\.pmc/;
die "this is not a .pl, .t or .pm file"
unless $pmc =~ /\.pmc/;
# test file dates
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PerlIO/via/SeqIO.pm view on Meta::CPAN
if ($file or $mode !~ /:via\(SeqIO(?:::[a-zA-Z_]+)?\)/) {
#passthru
# if !defined $file, parse $mode according to presence of &...
if ($fh) {
if ( $fh =~ /^[A-Z]+$/ ) {
$fh = *{(caller)[0]."::$fh"};
}
}
if ($file) {
if ( $file =~ /^[A-Z]+$/) {
$file = *{(caller)[0]."::$file"};
}
return CORE::open($fh || $_[0],$_[1],$file);
}
else {
$_[0] ?
lib/PerlIO/via/SeqIO.pm view on Meta::CPAN
no strict qw(refs);
my $dup = gensym;
my $bareword = $1;
my $redirect = ($bareword =~ /OUT/ ? ">&" : "<&");
# get a pristine copy of DATA/STDIN/STDOUT
$fh = *{(caller)[0]."::$bareword"};
CORE::open($dup, $redirect, $fh) or croak($!);
if ($bareword =~ /OUT/) {
$| && $dup->autoflush(1);
}
# now, need to make everything output to the duplicated
lib/PerlIO/via/SeqIO.pm view on Meta::CPAN
}
else { # passthru
$DB::single=1;
($mode, $file) = $mode =~ /(\+?(?:<|>)?>?&?)(.*)/;
$file =~ /^[A-Z]+$/ and $file = *{(caller)[0]."::$file"};
$_[0] = PerlIO::Util->open($mode,$file);
}
1;
}
lib/PerlIO/via/SeqIO.pm view on Meta::CPAN
};
m/via/ && do {
return (tied $sym)->via_o; last;
};
m/^[A-Z]+$/ && do {
$sym = (caller)[0]."::$sym";
return (tied *$sym)->via_o if (tied *$sym);
return;
last;
};
}
view all matches for this distribution
view release on metacpan or search on metacpan
PerlQt/lib/Qt/attributes.pm view on Meta::CPAN
# Attributes override any method with the same name, so you may want
# to prefix them with _ to prevent conflicts.
#
sub import {
my $class = shift;
my $caller = (caller)[0];
for my $attribute (@_) {
exists ${ ${$caller . '::META'}{'attributes'} }{$attribute} and next;
Qt::_internal::installattribute($caller, $attribute);
${ ${$caller . '::META'}{'attributes'} }{$attribute} = 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PerlX/ScopeFunction.pm view on Meta::CPAN
return \%import_as;
}
sub import ($class, @args) {
my $caller = (caller)[0];
my %handler = (
'let' =>[
sub { __define_keyword( \&__rewrite_let, $_[0] ) },
sub { __undefine_keyword( $_[0] ) },
],
lib/PerlX/ScopeFunction.pm view on Meta::CPAN
push @{ $STASH{$caller} }, sub { $unimporter->($as, $caller) };
}
}
sub unimport ($class) {
my $caller = (caller)[0];
for my $unimporter (@{ $STASH{$caller} // []}) {
$unimporter->();
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perlito5X/Exporter.pm view on Meta::CPAN
my $pkg = ref $self || $self;
return ${pkg}->VERSION($wanted);
}
sub export_tags {
_push_tags( (caller)[0], "EXPORT", \@_ );
}
sub export_ok_tags {
_push_tags( (caller)[0], "EXPORT_OK", \@_ );
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pinto/Util.pm view on Meta::CPAN
# TODO: Use Carp instead?
return 1 if not $ENV{PINTO_DEBUG};
$it = $it->() if ref $it eq 'CODE';
my ( $file, $line ) = (caller)[ 1, 2 ];
print {*STDERR} "$it in $file at line $line\n";
return 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pinwheel/Helpers/Text.pm view on Meta::CPAN
*p = *simple_format;
sub cycle
{
my ($ctx, $key, $i);
$key = (caller)[2] . "\t" . CORE::join("\t", @_);
$ctx = Pinwheel::Context::get('render');
$i = $ctx->{cycle}{$key}++;
return $_[$i % scalar(@_)];
}
view all matches for this distribution
view release on metacpan or search on metacpan
local/lib/perl5/IO/Compress/Base.pm view on Meta::CPAN
sub _def
{
my $obj = shift ;
my $class= (caller)[0] ;
my $name = (caller(1))[3] ;
$obj->croakError("$name: expected at least 1 parameters\n")
unless @_ >= 1 ;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plagger.pm view on Meta::CPAN
}
sub template {
my $self = shift;
$self->log(error => "\$context->template is DEPRECATED NOW. use \$plugin->templatize()");
my $plugin = shift || (caller)[0];
Plagger::Template->new($self, $plugin);
}
sub templatize {
my($self, $plugin, $file, $vars) = @_;
view all matches for this distribution