Perlito5
view release on metacpan or search on metacpan
lib/Perlito5X/Exporter.pm view on Meta::CPAN
}
}
sub require_version {
my ( $self, $wanted ) = @_;
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;
lib/Perlito5X/Getopt/Long.pm view on Meta::CPAN
my $default_config = do {
Getopt::Long::Configure ()
};
sub new {
my $that = shift;
my $class = ref($that) || $that;
my %atts = @_;
# Register the callers package.
my $self = { caller_pkg => (caller)[0] };
bless ($self, $class);
# Process config attributes.
if ( defined $atts{config} ) {
my $save = Getopt::Long::Configure ($default_config, @{$atts{config}});
$self->{settings} = Getopt::Long::Configure ($save);
delete ($atts{config});
}
# Else use default config.
lib/Perlito5X/Getopt/Long.pm view on Meta::CPAN
# Shift in default array.
unshift(@_, \@ARGV);
# Try to keep caller() and Carp consistent.
goto &GetOptionsFromArray;
}
sub GetOptionsFromString(@) {
my ($string) = shift;
require Text::ParseWords;
my $args = [ Text::ParseWords::shellwords($string) ];
$caller ||= (caller)[0]; # current context
my $ret = GetOptionsFromArray($args, @_);
return ( $ret, $args ) if wantarray;
if ( @$args ) {
$ret = 0;
warn("GetOptionsFromString: Excess data \"@$args\" in string \"$string\"\n");
}
$ret;
}
sub GetOptionsFromArray(@) {
my ($argv, @optionlist) = @_; # local copy of the option descriptions
my $argend = '--'; # option list terminator
my %opctl = (); # table of option specs
my $pkg = $caller || (caller)[0]; # current context
# Needed if linkage is omitted.
my @ret = (); # accum for non-options
my %linkage; # linkage
my $userlinkage; # user supplied HASH
my $opt; # current option
my $prefix = $genprefix; # current prefix
$error = '';
if ( $debug ) {
lib/Perlito5X/Java/SelfLoader.pm view on Meta::CPAN
if ($@) {
$@ =~ s/ at .*\n//;
croak $@;
}
$@ = $save;
defined(&$AUTOLOAD) || die "SelfLoader inconsistency error";
delete $Cache{$AUTOLOAD};
goto &$AUTOLOAD
}
sub load_stubs { shift->_load_stubs((caller)[0]) }
sub _load_stubs {
# $endlines is used by Devel::SelfStubber to capture lines after __END__
my($self, $callpack, $endlines) = @_;
no strict "refs";
my $fh = \*{"${callpack}::DATA"};
use strict;
my $currpack = $callpack;
my($line,$name,@lines, @stubs, $protoype);
lib/Perlito5X/SelfLoader.pm view on Meta::CPAN
if ($@) {
$@ =~ s/ at .*\n//;
croak $@;
}
$@ = $save;
defined(&$AUTOLOAD) || die "SelfLoader inconsistency error";
delete $Cache{$AUTOLOAD};
goto &$AUTOLOAD
}
sub load_stubs { shift->_load_stubs((caller)[0]) }
sub _load_stubs {
# $endlines is used by Devel::SelfStubber to capture lines after __END__
my($self, $callpack, $endlines) = @_;
no strict "refs";
my $fh = \*{"${callpack}::DATA"};
use strict;
my $currpack = $callpack;
my($line,$name,@lines, @stubs, $protoype);
lib/Perlito5X/warnings.pm view on Meta::CPAN
# Any changes made here will be lost!
package warnings;
our $VERSION = "1.42";
# Verify that we're called correctly so that warnings will work.
# Can't use Carp, since Carp uses us!
# String regexps because constant folding = smaller optree = less memory vs regexp literal
# see also strict.pm.
die sprintf "Incorrect use of pragma '%s' at %s line %d.\n", __PACKAGE__, +(caller)[1,2]
if __FILE__ !~ ( '(?x) \b '.__PACKAGE__.' \.pmc? \z' )
&& __FILE__ =~ ( '(?x) \b (?i:'.__PACKAGE__.') \.pmc? \z' );
our %Offsets = (
# Warnings Categories added in Perl 5.008
'all' => 0,
'closure' => 2,
'deprecated' => 4,
'exiting' => 6,
'glob' => 8,
( run in 0.629 second using v1.01-cache-2.11-cpan-a3c8064c92c )