Alt-Acme-Math-XS-ModuleInstall
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
#==============================================================================
sub import {
my $class = shift;
$class->import_heavy(@_);
}
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::/;
croak M02_usage();
}
$CONFIG{$pkg}{template} ||= $default_config;
inc/Inline/C.pm view on Meta::CPAN
sub parse {
my $o = shift;
return if $o->{ILSM}{parser};
return if $o->{ILSM}{XSMODE};
my $parser = $o->{ILSM}{parser} = $o->get_parser;
$parser->{data}{typeconv} = $o->{ILSM}{typeconv};
$parser->{data}{AUTOWRAP} = $o->{ILSM}{AUTOWRAP};
Inline::Struct::parse($o) if $o->{STRUCT}{'.any'};
$parser->code($o->{ILSM}{code})
or croak <<END;
Bad $o->{API}{language} code passed to Inline at @{[caller(2)]}
END
}
# Create and initialize a parser
sub get_parser {
my $o = shift;
Inline::C::_parser_test($o->{CONFIG}{DIRECTORY}, "Inline::C::get_parser called\n")
if $o->{CONFIG}{_TESTING};
require Inline::C::Parser::RecDescent;
Inline::C::Parser::RecDescent::get_parser($o);
inc/Inline/denter.pm view on Meta::CPAN
# Prevent a taint exception being thrown by AutoLoader.pm.
# Serves no other purpose.
sub DESTROY {
}
sub undent {
local $/ = "\n";
my ($o, $text) = @_;
my ($comma) = $o->{comma};
my $package = caller;
$package = caller(1) if $package eq 'Inline::denter';
%{$o->{xref}} = ();
@{$o->{objects}} = ();
@{$o->{context}} = ();
my $glob = '';
chomp $text;
@{$o->{lines}} = split $/, $text;
$o->{level} = 0;
$o->{line} ||= 1;
$o->_setup_line;
while (not $o->{done}) {
inc/Inline/denter.pm view on Meta::CPAN
croak $o->M01_invalid_indent_width unless /^(( {$width})*)(\S.*)$/;
$o->{level} = length($1) / $width;
$o->{content} = $3;
last;
}
}
sub indent {
my $o = shift;
my $package = caller;
$package = caller(1) if $package eq 'Inline::denter';
my $stream = '';
$o->{key} = '';
while (@_) {
local $_ = shift;
$stream .= $o->indent_name($_, shift), next
if (/^\*$package\::\w+$/);
$stream .= $o->indent_data($_);
}
return $stream;
}
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
eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _read {
local *FH;
open( FH, '<', $_[0] ) or die "open($_[0]): $!";
binmode FH;
inc/Module/Install/Makefile.pm view on Meta::CPAN
}
sub Makefile { $_[0] }
my %seen = ();
sub prompt {
shift;
# Infinite loop protection
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing or non-interactive session, always use defaults
if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
( run in 0.339 second using v1.01-cache-2.11-cpan-26ccb49234f )