App-Framework-Lite
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
$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;
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
return $string;
}
END_NEW
sub _read {
local *FH;
open( FH, "< $_[0]" ) or die "open($_[0]): $!";
binmode FH;
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
return $string;
}
END_OLD
sub _readperl {
my $string = Module::Install::_read($_[0]);
$string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
$string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s;
inc/Module/Install.pm view on Meta::CPAN
$string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg;
$string =~ s/^\n+//s;
return $string;
}
# Done in evals to avoid confusing Perl::MinimumVersion
eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _write {
local *FH;
open( FH, '>', $_[0] ) or die "open($_[0]): $!";
binmode FH;
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
close FH or die "close($_[0]): $!";
}
END_NEW
sub _write {
local *FH;
open( FH, "> $_[0]" ) or die "open($_[0]): $!";
binmode FH;
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
close FH or die "close($_[0]): $!";
}
END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version {
inc/Module/Install/Can.pm view on Meta::CPAN
# No working C compiler
return 0;
}
# Write a C file representative of what XS becomes
require File::Temp;
my ( $FH, $tmpfile ) = File::Temp::tempfile(
"compilexs-XXXXX",
SUFFIX => '.c',
);
binmode $FH;
print $FH <<'END_C';
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
int main(int argc, char **argv) {
return 0;
}
int boot_sanexs() {
lib/App/Framework/Lite.pm view on Meta::CPAN
## File open
if ($open_in && ($arg_names_href->{$name}{'type'} eq 'f'))
{
open my $fh, "<$val" ;
if ($fh)
{
push @$fh_aref, $fh ;
if ($arg_names_href->{$name}{'mode'} eq 'b')
{
binmode $fh ;
}
# Create new entry
my $href = $this->_new_arg_entry($fh_name) ;
$arg_names_href->{$fh_name} = $href ;
# set value
if ($arg_names_href->{$name}{'dest_type'})
{
$args_href->{$fh_name} ||= [] ;
lib/App/Framework/Lite.pm view on Meta::CPAN
$mode .= '>' ;
}
open my $fh, "$mode$val" ;
if ($fh)
{
push @$fh_aref, $fh ;
if ($arg_names_href->{$name}{'mode'} eq 'b')
{
binmode $fh ;
}
# Create new entry
my $href = $this->_new_arg_entry($fh_name) ;
$arg_names_href->{$fh_name} = $href ;
# set value
$args_href->{$fh_name} = $fh ;
}
else
( run in 1.314 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )