view release on metacpan or search on metacpan
lib/Tickit/Style.pm view on Meta::CPAN
sub load_style_file
{
shift;
my ( $path ) = @_;
# TODO: use ->from_file( $path, binmode => ":encoding(UTF-8)" ) when available
my $str = do {
open my $fh, "<:encoding(UTF-8)", $path or croak "Cannot read $path - $!";
local $/;
<$fh>;
};
view all matches for this distribution
view release on metacpan or search on metacpan
div128|||
djSP|||
do_aexec5|||
do_aexec|||
do_aspawn|||
do_binmode||5.004050|
do_chomp|||
do_chop|||
do_close|||
do_dump_pad|||
do_eof|||
view all matches for this distribution
view release on metacpan or search on metacpan
bin/linkBags view on Meta::CPAN
select((select(STDERR), $| = 1)[0]);
# encoding pragmas follow any includes like "use"
use encoding 'utf8';
use open ':utf8';
binmode STDIN, ":utf8";
binmode STDERR, ":utf8";
# command line inputs
my $gzip = 0;
my $stem = "";
my $file = "";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/Buffer.pm view on Meta::CPAN
use warnings;
use Time::Simple;
use encoding 'utf8';
use open ':utf8';
binmode STDIN, ":utf8";
binmode STDERR, ":utf8";
our $VERSION = '0.10';
=head1 NAME
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/NLPPlatform.pm view on Meta::CPAN
$rec = $records[$i];
($id,$docR)=@$rec;
warn "Process document $id\n";
open FILETMP_OUT, ">$tmpfile";
binmode(FILETMP_OUT, ":utf8");
# binmode(FILETMP_OUT);
# print FILETMP_OUT Encode::decode_utf8($doc);
Alvis::NLPPlatform::platform_reset();
$render_time = Alvis::NLPPlatform::standalone_main($config, $docR, \*FILETMP_OUT, 1); #${$tab_docs_xml->[$doc_num]}[1] ; ${$ref_doc}[1]
close(FILETMP_OUT);
lib/Alvis/NLPPlatform.pm view on Meta::CPAN
# PeerPort => $nlp_port,
# Proto => 'tcp');
# die "Could not create socket: $!\n" unless $sock;
$sock -> autoflush(1); ###############
binmode($sock, ":utf8");
print STDERR `date`;
print STDERR "Established connection to server.\n";
print STDERR "Requesting document...";
print $sock "REQUEST\n";
lib/Alvis/NLPPlatform.pm view on Meta::CPAN
} while(!defined($sock) && ($connection_retry >0));
if ($connection_retry ==0) {
die "Timeout. Could not create socket: $! \n";
}
binmode $sock, ":utf8";
print STDERR "Established connection to server.\n";
print STDERR "Giving back annotated document...\n";
# Communitation with the server
lib/Alvis/NLPPlatform.pm view on Meta::CPAN
if ($connection_retry ==0) {
die "Timeout. Could not create socket: $! \n";
}
$sock -> autoflush(1); ###############
binmode $sock, ":utf8";
print STDERR "Established connection to server.\n";
print STDERR "Sending aborting message\n";
lib/Alvis/NLPPlatform.pm view on Meta::CPAN
# await client connection
if ($client_sock=$sock->accept()) {
warn "Accepting a connection\n";
if (fork() == 0) {
close($sock);
binmode($client_sock, ":utf8");
my ($client_port,$client_iaddr) = sockaddr_in(getpeername($client_sock));
warn "Getting information about remote host\n";
$name=gethostbyaddr($client_iaddr,AF_INET);
&disp_log($name,"Client (".inet_ntoa($client_iaddr).":".$client_port.") has connected.");
$client_sock -> autoflush(1); ###############
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/Pipeline/Read.pm view on Meta::CPAN
$lastread++;
my $filename = "$dir/$lastread";
my $f2 = new IO::File("<$filename")
or die "can't read file '$filename': $!";
binmode $f2, ":utf8";
my $doc = join("", <$f2>);
$f2->close();
unlink($filename);
$this->_write_and_unlock($dir, $fh, $lastread, $lastwrite);
lib/Alvis/Pipeline/Read.pm view on Meta::CPAN
while (1) {
$this->log(1, "accepting connection");
$this->{socket} = $listener->accept()
or die "can't accept connection: $!";
binmode $this->{socket}, ":utf8";
$this->log(1, "started background process, pid $$");
while (1) {
my $doc = $this->_read();
last if !defined $doc;
$this->_store_file($doc);
lib/Alvis/Pipeline/Read.pm view on Meta::CPAN
$lastwrite++;
my $filename = "$dir/$lastwrite";
my $f2 = new IO::File(">$filename")
or die "can't create new file '$filename': $!";
binmode $f2, ":utf8";
$f2->print($doc) or die "can't write '$filename': $!";
$f2->close() or die "can't close '$filename': $!";
$this->_write_and_unlock($dir, $fh, $lastread, $lastwrite);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/Treetagger.pm view on Meta::CPAN
use strict;
use warnings;
use encoding 'utf8';
use open ':utf8';
binmode STDERR, ":utf8";
our $commandLine;
our $taggerRoot;
our $FIFO;
our $parFile;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/Saa.pm view on Meta::CPAN
$this->{'err'} = "$@";
close($inet_sock);
return 0;
}
binmode($inet_sock, ":raw");
binmode($unix_sock, ":raw");
$serv->{'inet_sock'} = $inet_sock;
$serv->{'unix_sock'} = $unix_sock;
$this->{'servs'}->{$port} = $serv;
lib/Alvis/Saa.pm view on Meta::CPAN
else
{
$debug && print STDERR "Saa::connect(): Successfully opened localsoc!\n";
}
binmode($conn, ":raw");
$cn->{'conn'} = $conn;
$this->{'conn_sel'}->add($conn);
$this->{'conns'}->{"${host}_$port"} = $cn;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/TermTagger.pm view on Meta::CPAN
warn "Loading the terminological resource\n";
open DESC_TERMLIST, $termlist_name or die "$0: $termlist_name: No such file\n";
binmode(DESC_TERMLIST, ":utf8");
while($line1 = <DESC_TERMLIST>) {
chomp $line1;
utf8::decode($line1);
$line=$line1;
lib/Alvis/TermTagger.pm view on Meta::CPAN
warn "Loading the corpus\n";
open CORPUS, $corpus_filename or die "File $corpus_filename not found\n";
binmode(CORPUS, ":utf8");
while($line=<CORPUS>){
$lineLen = length($line);
chomp $line;
$ref_tabh_Corpus->{$sent_id}->{'line'} = $line;
lib/Alvis/TermTagger.pm view on Meta::CPAN
warn "Term tagging\n";
open TAGGEDCORPUS, ">>$offset_tagged_corpus_name" or die "$0: $offset_tagged_corpus_name: No such file\n";
binmode(TAGGEDCORPUS, ":utf8");
foreach $counter (keys %$ref_tabh_idtrm_select) {
$term_regex = $ref_regex_termlist->[$counter];
$termField2 = 0;
if (defined $ref_termlist->[$counter]->[$termField]) {
lib/Alvis/TermTagger.pm view on Meta::CPAN
warn "Term tagging ($offset_tagged_corpus_name)\n";
open TAGGEDCORPUS, ">$offset_tagged_corpus_name" or die "$0: $offset_tagged_corpus_name: No such file\n";
binmode(TAGGEDCORPUS, ":utf8");
if (!defined $termField) {
$termField = 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} }
$^X, @switches, '-e', "require q[$lib]"))
if $ENV{PERL_COMPILE_TEST_DEBUG};
my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($?, 0, "$lib loaded ok");
shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
view all matches for this distribution
view release on metacpan or search on metacpan
t/job-selection.t view on Meta::CPAN
use Data::Dumper;
use Test::More;
use DateTime;
use DBI;
binmode STDOUT, ':utf8';
binmode STDERR, ':utf8';
my $feed_dir = 't/feeds';
if (-d 'schemas') {
plan tests => 12;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3/Bucket.pm view on Meta::CPAN
if !-r $filename || !$remaining;
my $fh = IO::File->new( $filename, 'r' )
or croak "Could not open $filename: $OS_ERROR";
$fh->binmode;
return sub {
my $buffer;
# upon retries the file is closed and we must reopen it
if ( !$fh->opened ) {
$fh = IO::File->new( $filename, 'r' )
or croak "Could not open $filename: $OS_ERROR";
$fh->binmode;
$remaining = $stat->size;
}
my $read = $fh->read( $buffer, $blksize );
view all matches for this distribution
view release on metacpan or search on metacpan
DEV_NULL = > NUL
MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e mkpath --
EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e eqtime --
FALSE = $(ABSPERLRUN) -e "exit 1" --
TRUE = $(ABSPERLRUN) -e "exit 0" --
ECHO = $(ABSPERLRUN) -l -e "binmode STDOUT, qq{{:raw}}; print qq{{@ARGV}}" --
ECHO_N = $(ABSPERLRUN) -e "print qq{{@ARGV}}" --
UNINST = 0
VERBINST = 0
MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e "install([ from_to => {{@ARGV}}, verbose => '$(VERBINST)', uninstall_shadows => '$(UNINST)', dir_mode => '$(PERM_DIR)' ]);" --
DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e perllocal_install --
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amon2/Setup/Flavor/Lite.pm view on Meta::CPAN
our @EXPORT = qw//;
{
# utf8 hack.
binmode Test::More->builder->$_, ":utf8" for qw/output failure_output todo_output/;
no warnings 'redefine';
my $code = \&Test::Builder::child;
*Test::Builder::child = sub {
my $builder = $code->(@_);
binmode $builder->output, ":utf8";
binmode $builder->failure_output, ":utf8";
binmode $builder->todo_output, ":utf8";
return $builder;
};
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
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"
view all matches for this distribution
view release on metacpan or search on metacpan
share/flavor/Minimum/t/Util.pm view on Meta::CPAN
<% block export -> { } %>
);
{
# utf8 hack.
binmode Test::More->builder->$_, ":utf8" for qw/output failure_output todo_output/;
no warnings 'redefine';
my $code = \&Test::Builder::child;
*Test::Builder::child = sub {
my $builder = $code->(@_);
binmode $builder->output, ":utf8";
binmode $builder->failure_output, ":utf8";
binmode $builder->todo_output, ":utf8";
return $builder;
};
}
<% block functions -> { %>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Android/Build.pm view on Meta::CPAN
# Tests and documentation
sub test
{my $p = __PACKAGE__;
binmode($_, ":utf8") for *STDOUT, *STDERR;
return if eval "eof(${p}::DATA)";
my $s = eval "join('', <${p}::DATA>)";
$@ and die $@;
eval $s;
$@ and die $@;
view all matches for this distribution
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} }
$^X, @switches, '-e', "require q[$lib]"))
if $ENV{PERL_COMPILE_TEST_DEBUG};
my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($?, 0, "$lib loaded ok");
shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
view all matches for this distribution
view release on metacpan or search on metacpan
src/ppport.h view on Meta::CPAN
div128|||
djSP|||
do_aexec5|||
do_aexec|||
do_aspawn|||
do_binmode||5.004050|
do_chomp|||
do_close|||
do_delete_local|||
do_dump_pad|||
do_eof|||
view all matches for this distribution
view release on metacpan or search on metacpan
my $isWin = $FALSE;
my $pltFrm = $^O;
if ($pltFrm =~ /win32/i) {
$pltFrm = "MSWIN";
$isWin = $TRUE;
binmode(STDOUT, ":encoding(cp437)"); # für die korrekte Darstellung deutscher Umlaute
}
else {
$pltFrm = "UNIX";
}
my $ed = Ante::Deluvian::Dialog->new(
view all matches for this distribution
view release on metacpan or search on metacpan
xt/author/00-compile.t view on Meta::CPAN
diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} }
$^X, @switches, '-e', "require q[$lib]"))
if $ENV{PERL_COMPILE_TEST_DEBUG};
my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($?, 0, "$lib loaded ok");
shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyData/Storage/File.pm view on Meta::CPAN
die "Cannot read file '$file': doesn't exist!" unless -f $file;
if (!($fh = IO::File->new($file, $mode{$open_mode}))) {
die " Cannot open '$file': $!";
}
}
binmode($fh);
$fh->autoflush(1);
if ( HAS_FLOCK ) {
if ( $open_mode eq 'r') {
if (!flock($fh, LOCK_SH)) {
die "Cannot obtain shared lock on '$file': $!";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyData2/Storage.pm view on Meta::CPAN
=head2 read
my $buf = $stor->read(<characters>)
Use binmode for characters as synonymous for bytes.
=cut
sub read
{
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
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"
view all matches for this distribution
view release on metacpan or search on metacpan
t/01_base.t view on Meta::CPAN
BEGIN {
# ÐодгоÑовка обÑекÑа ÑеÑÑиÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð´Ð»Ñ ÑабоÑÑ Ñ utf8
my $builder = Test::More->builder;
binmode $builder->output, ":utf8";
binmode $builder->failure_output, ":utf8";
binmode $builder->todo_output, ":utf8";
# use_ok 'AnyEvent::Impl::EV';
use_ok 'AnyEvent';
use_ok 'AnyEvent::AggressiveIdle';
}
view all matches for this distribution
view release on metacpan or search on metacpan
eg/stream-client.pl view on Meta::CPAN
my $url = "http://updates.sixapart.com/atom-stream.xml";
my $cv = AnyEvent->condvar;
# API is compatible to XML::Atom::Stream
binmode STDOUT, ":utf8";
my $client = AnyEvent::Atom::Stream->new(
callback => sub {
my $feed = shift;
for my $entry ($feed->entries) {
view all matches for this distribution
view release on metacpan or search on metacpan
t/010-ae-cb.t view on Meta::CPAN
BEGIN {
# ÐодгоÑовка обÑекÑа ÑеÑÑиÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð´Ð»Ñ ÑабоÑÑ Ñ utf8
my $builder = Test::More->builder;
binmode $builder->output, ":utf8";
binmode $builder->failure_output, ":utf8";
binmode $builder->todo_output, ":utf8";
use_ok 'AnyEvent::Callback';
}
#
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Builder.pm view on Meta::CPAN
$self->_try(
sub {
require PerlIO;
my @src_layers = PerlIO::get_layers($src);
binmode $dst, join " ", map ":$_", @src_layers if @src_layers;
}
);
return;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
# see L<perlfaq8/How can I capture STDERR from an external command?>
open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
my $stderr = IO::Handle->new;
my $pid = open3($stdin, '>&STDERR', $stderr, $^X, '-Mblib', '-e', "require q[$lib]");
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($? >> 8, 0, "$lib loaded ok");
if (@_warnings)
view all matches for this distribution
view release on metacpan or search on metacpan
util/gen_uts46data view on Meta::CPAN
use common::sense;
use utf8;
no warnings 'utf8';
binmode STDOUT, ":utf8";
open my $fh, "GET http://www.unicode.org/Public/idna/9.0.0/IdnaMappingTable.txt |"
or die;
my $valid;
util/gen_uts46data view on Meta::CPAN
}
}
open my $fh, ">lib/AnyEvent/Util/uts46data.pl"
or die;
binmode $fh, ":perlio";
print $fh "# autogenerated by util/gen_uts46data\n";
utf8::encode $imap;
0 > index $imap, "\x02" # it's not supposed to be anywhere in there
or die "imap contains \\x02";
view all matches for this distribution