Alien-wxWidgets
view release on metacpan or search on metacpan
inc/bin/patch view on Meta::CPAN
use vars qw/$ERROR/;
# Class data.
BEGIN {
$ERROR = 0;
}
sub import {
no strict 'refs';
*{caller() . '::throw'} = \&throw;
@{caller() . '::ISA'} = 'Patch';
}
# Simple throw/catch error handling.
sub throw {
$@ = join '', @_;
$@ .= sprintf " at %s line %d\n", (caller)[1..2] unless $@ =~ /\n\z/;
goto CATCH;
}
# Prints a prompt message and returns response.
inc/inc_Locale-Maketext-Simple/Locale/Maketext/Simple.pm view on Meta::CPAN
$args{Class} ||= caller;
$args{Style} ||= 'maketext';
$args{Export} ||= 'loc';
$args{Subclass} ||= 'I18N';
my ($loc, $loc_lang) = $class->load_loc(%args);
$loc ||= $class->default_loc(%args);
no strict 'refs';
*{caller(0) . "::$args{Export}"} = $loc if $args{Export};
*{caller(0) . "::$args{Export}_lang"} = $loc_lang || sub { 1 };
}
my %Loc;
sub reload_loc { %Loc = () }
sub load_loc {
my ($class, %args) = @_;
my $pkg = join('::', grep { defined and length } $args{Class}, $args{Subclass});
inc/inc_Module-Load/Module/Load.pm view on Meta::CPAN
}
__PACKAGE__->_export_to_level(1, $mod, @_) if @_;
}
### 5.004's Exporter doesn't have export_to_level.
### Taken from Michael Schwerns Test::More and slightly modified
sub _export_to_level {
my $pkg = shift;
my $level = shift;
my $mod = shift;
my $callpkg = caller($level);
$mod->export($callpkg, @_);
}
sub _to_file{
local $_ = shift;
my $pm = shift || '';
my @parts = split /::/;
### because of [perl #19213], see caveats ###
my $file = $^O eq 'MSWin32'
? join "/", @parts
: File::Spec->catfile( @parts );
$file .= '.pm' if $pm;
return $file;
}
sub _who { (caller(1))[0] }
sub _is_file {
local $_ = shift;
return /^\./ ? 1 :
/[^\w:']/ ? 1 :
undef
#' silly bbedit..
}
inc/inc_Params-Check/Params/Check.pm view on Meta::CPAN
sub _safe_eq {
### only do a straight 'eq' if they're both defined ###
return defined($_[0]) && defined($_[1])
? $_[0] eq $_[1]
: defined($_[0]) eq defined($_[1]);
}
sub _who_was_it {
my $level = $_[0] || 0;
return (caller(2 + $CALLER_DEPTH + $level))[3] || 'ANON'
}
=head2 last_error()
Returns a string containing all warnings and errors reported during
the last time C<check> was called.
This is useful if you want to report then some other way than
C<carp>'ing when the verbose flag is on.
inc/inc_Params-Check/Params/Check.pm view on Meta::CPAN
=head2 $Params::Check::WARNINGS_FATAL
If set to true, L<Params::Check> will C<croak> when an error during
template validation occurs, rather than return C<false>.
Default is 0;
=head2 $Params::Check::CALLER_DEPTH
This global modifies the argument given to C<caller()> by
C<Params::Check::check()> and is useful if you have a custom wrapper
function around C<Params::Check::check()>. The value must be an
integer, indicating the number of wrapper functions inserted between
the real function call and C<Params::Check::check()>.
Example wrapper function, using a custom stacktrace:
sub check {
my ($template, $args_in) = @_;
inc/inc_version/version.pm view on Meta::CPAN
*version::qv = \&version::vpp::qv;
}
else { # use XS module
push @ISA, "version::vxs";
*version::qv = \&version::vxs::qv;
}
# Preloaded methods go here.
sub import {
my ($class) = shift;
my $callpkg = caller();
no strict 'refs';
*{$callpkg."::qv"} =
sub {return bless version::qv(shift), $class }
unless defined(&{"$callpkg\::qv"});
# if (@_) { # must have initialization on the use line
# if ( defined $_[2] ) { # CVS style
# $_[0] = version::qv($_[2]);
# }
( run in 0.361 second using v1.01-cache-2.11-cpan-b61123c0432 )