Alien-ROOT
view release on metacpan or search on metacpan
inc/inc_File-Fetch/File/Fetch.pm view on Meta::CPAN
my $fh = FileHandle->new;
unless ( $fh->open($to,'>') ) {
return $self->_error(loc(
"Could not open '%1' for writing: %2",$to,$!));
}
$fh->autoflush(1);
binmode $fh;
my $rc = $http->request( $uri, sub { my ($self,$dref,$cbargs) = @_; local $\; print {$cbargs} $$dref }, $fh );
close $fh;
if ( $rc == 301 || $rc == 302 ) {
my $loc;
HEADERS: for ($http->headers_array) {
/Location: (\S+)/ and $loc = $1, last HEADERS;
}
inc/inc_File-Fetch/File/Fetch.pm view on Meta::CPAN
my $fh = FileHandle->new;
# Check open()
unless ( $fh->open($to,'>') ) {
return $self->_error(loc(
"Could not open '%1' for writing: %2",$to,$!));
}
$fh->autoflush(1);
binmode $fh;
my $path = File::Spec::Unix->catfile( $self->path, $self->file );
my $req = "GET $path HTTP/1.0\x0d\x0aHost: " . $self->host . "\x0d\x0a\x0d\x0a";
$sock->send( $req );
my $select = IO::Select->new( $sock );
my $resp = '';
my $normal = 0;
while ( $select->can_read( $TIMEOUT || 60 ) ) {
inc/inc_Module-Build/Module/Build/PPMMaker.pm view on Meta::CPAN
$ppd .= <<'EOF';
</IMPLEMENTATION>
</SOFTPKG>
EOF
my $ppd_file = "$dist{name}.ppd";
my $fh = IO::File->new(">$ppd_file")
or die "Cannot write to $ppd_file: $!";
my $io_file_ok = eval { IO::File->VERSION(1.13); 1 };
$fh->binmode(":utf8")
if $io_file_ok && $fh->can('binmode') && $] >= 5.008 && $Config{useperlio};
print $fh $ppd;
close $fh;
return $ppd_file;
}
sub _ppd_version {
my ($self, $version) = @_;
# generates something like "0,18,0,0"
( run in 0.438 second using v1.01-cache-2.11-cpan-8d75d55dd25 )