Acme-MITHALDU-XSGrabBag
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
use Fcntl qw(LOCK_EX LOCK_UN);
my %CONFIG = ();
my @DATA_OBJS = ();
my $INIT = 0;
my $version_requested = 0;
my $version_printed = 0;
my $untaint = 0;
my $safemode = 0;
our $languages = undef;
our $did = '_Inline'; # Default Inline Directory
# This is the config file written by create_config_file().
our $configuration_file = 'config-' . $Config::Config{'archname'} . '-' . $];
my %shortcuts =
(
NOCLEAN => [CLEAN_AFTER_BUILD => 0],
CLEAN => [CLEAN_BUILD_AREA => 1],
inc/Inline.pm view on Meta::CPAN
VERSION => [PRINT_VERSION => 1],
REPORTBUG => [REPORTBUG => 1],
UNTAINT => [UNTAINT => 1],
SAFE => [SAFEMODE => 1],
UNSAFE => [SAFEMODE => 0],
GLOBAL => [GLOBAL_LOAD => 1],
NOISY => [BUILD_NOISY => 1],
TIMERS => [BUILD_TIMERS => 1],
NOWARN => [WARNINGS => 0],
_INSTALL_ => [_INSTALL_ => 1],
SITE_INSTALL => undef, # No longer supported.
);
my $default_config =
{
NAME => '',
AUTONAME => -1,
VERSION => '',
DIRECTORY => '',
WITH => [],
USING => [],
inc/Inline.pm view on Meta::CPAN
}
#==============================================================================
# Blindly untaint tainted fields in %ENV.
#==============================================================================
sub env_untaint {
my $o = shift;
warn "In Inline::env_untaint() : Blindly untainting tainted fields in %ENV.\n" unless $o->{CONFIG}{NO_UNTAINT_WARN};
{
no warnings ('uninitialized'); # In case $ENV{$_} is set to undef.
for (keys %ENV) {
($ENV{$_}) = $ENV{$_} =~ /(.*)/;
}
}
# only accept dirs that are absolute and not world-writable
$ENV{PATH} = $^O eq 'MSWin32' ?
join ';', grep {not /^\./ and -d $_
} split /;/, $ENV{PATH}
:
inc/Inline/denter.pm view on Meta::CPAN
}
elsif ($1 eq '@') {
@$obj = $o->_undent_array;
}
else {
$$obj = $o->_undent_scalar;
}
bless $obj, $class if length $class;
}
elsif ($o->{content} =~ /^\?\s*$/) {
$obj = $o->_undent_undef;
}
else {
$obj = $o->_undent_value;
}
while (@refs) {
my $ref = pop @refs;
my $copy = $obj;
$obj = \ $copy;
$o->{xref}{$ref} = $obj if $ref;
}
inc/Inline/denter.pm view on Meta::CPAN
}
sub _undent_scalar {
my $values;
my $o = shift;
my $level = $o->{level} + 1;
$o->_next_line;
$o->_setup_line;
croak $o->M06_invalid_indent_level if $o->{level} != $level;
croak $o->M07_invalid_scalar_value if $o->{content} =~ /^[\%\@\$\\]/;
return $o->_undent_undef if $o->{content} =~ /^\?/;
return $o->_undent_value;
}
sub _undent_undef {
my $o = shift;
$o->_next_line;
$o->_setup_line;
return undef;
}
sub _next_line {
my $o = shift;
$o->{done}++, $o->{level} = -1, return unless @{$o->{lines}};
local $_ = shift @{$o->{lines}};
$o->{line}++;
}
sub _setup_line {
inc/Inline/denter.pm view on Meta::CPAN
$stream .= $o->indent_name($_, shift), next
if (/^\*$package\::\w+$/);
$stream .= $o->indent_data($_);
}
return $stream;
}
sub indent_data {
my $o = shift;
local $_ = shift;
return $o->indent_undef($_)
if not defined;
return $o->indent_value($_)
if (not ref);
return $o->indent_hash($_)
if (ref eq 'HASH' and not /=/ or /=HASH/);
return $o->indent_array($_)
if (ref eq 'ARRAY' and not /=/ or /=ARRAY/);
return $o->indent_scalar($_)
if (ref eq 'SCALAR' and not /=/ or /=SCALAR/);
return $o->indent_ref($_)
inc/Inline/denter.pm view on Meta::CPAN
}
sub indent_ref {
my ($o, $data) = @_;
my $stream = $o->_print_ref($data, '\\', 'SCALAR');
return $$stream if ref $stream;
chomp $stream;
return $stream . $o->indent_data($$data);
}
sub indent_undef {
my ($o, $data) = @_;
my $stream = "?\n";
$stream .= $o->{key}, $o->{key} = '' if $o->{key};
return $stream;
}
sub indent_name {
my ($o, $name, $value) = @_;
$name =~ s/^.*:://;
my $stream = $name . $o->{comma};
( run in 1.071 second using v1.01-cache-2.11-cpan-d80b1682f3f )