view release on metacpan or search on metacpan
eg/track.pl view on Meta::CPAN
my $done = AE::cv;
my($user, $password, $method, %args) = @ARGV;
binmode STDOUT, ":utf8";
my $streamer = AnyEvent::Twitter::Stream->new(
username => $user,
password => $password,
method => $method || "sample",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Worker.pm view on Meta::CPAN
sub new {
my ($class, $cb, %arg) = @_;
my ($client, $server) = AnyEvent::Util::portable_socketpair
or croak "unable to create Anyevent::Worker communications pipe: $!";
binmode $client, ':raw';
binmode $server, ':raw';
my $self = bless \%arg, $class;
$self->{fh} = $client;
AnyEvent::Util::fh_nonblocking $client, 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/XMPP/SimpleConnection.pm view on Meta::CPAN
}
$self->{peer_host} = $peerhost;
$self->{peer_port} = $peerport;
binmode $fh, ":raw";
$self->{handle} =
AnyEvent::Handle->new (
fh => $fh,
on_eof => sub {
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_close|||
do_delete_local|||
do_dump_pad|||
do_eof|||
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_close|||
do_delete_local|||
do_dump_pad|||
do_eof|||
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
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
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
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
lib/Aozora2Epub/Epub.pm view on Meta::CPAN
}
sub write_string {
my ($self, $bin, $to) = @_;
my $dest = $self->dest_file($to);
$dest->spew({binmode => ":raw"}, $bin);
}
sub files_in_dir {
my $dir = shift;
my @files;
view all matches for this distribution
view release on metacpan or search on metacpan
t/01_basic.t view on Meta::CPAN
use warnings;
use utf8;
use AozoraBunko::Checkerkun;
use Test::More;
use Test::Fatal;
binmode Test::More->builder->$_ => ':utf8' for qw/output failure_output todo_output/;
can_ok('AozoraBunko::Checkerkun', qw/new check/);
my %option = (
'gaiji' => 1, # JISå¤åããã§ãã¯ãã
view all matches for this distribution
view release on metacpan or search on metacpan
For an example of BinaryWrite, see the binary_write.htm example
in ./site/eg/binary_write.htm
Please note that if you are on Win32, you will need to
call binmode on a file handle before reading, if
its data is binary.
=item $Response->Clear()
Erases buffered ASP output.
=item $VERSION = 2.55; $DATE="08/09/2003"
- Bug fixes for running on standalone CGI mode on Win32 submitted
by Francesco Pasqualini
+ Added Apache::ASP::Request::BINMODE for binmode() being
called on STDIN after STDIN is tied to $Request object
+ New RequestBinaryRead configuration created, may be turned off
to prevent $Request object from reading POST data
includes, global.asa, or scripts when changed.
+FileUpload file handles cleanup at garbage collection
time so developer does not have to worry about lazy coding
and undeffing filehandles used in code. Also set
uploaded filehandles to binmode automatically on Win32
platforms, saving the developer yet more typing.
+FileUploadTemp setting, default 0, if set will leave
a temp file on disk during the request, which may be
helpful for processing by other programs, but is also
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Backend/POE/Connection.pm view on Meta::CPAN
#croak "Couldn't connect to $self->{host} : $self->{port} - $!";
print STDERR "$$ Apache::Backend::POE:Connection Couldn't connect to $self->{host} : $self->{port} - $!\n";
return undef;
};
binmode($self->{socket});
#$self->{socket}->autoflush(1); # default
$self->{socket}->blocking(0);
$self->{buffer} = "";
$self->{read_length} = undef;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/ConfigParser.pm view on Meta::CPAN
# Change the mode to binary to mode to handle the line continuation
# match [^\\]\\[\r]\n. Since binary files may be copied from
# Windows to Unix, look for this exact match instead of relying upon
# the operating system to convert \r\n to \n.
binmode($fd);
# This holds the contents of any previous lines that are continued
# using \ at the end of the line. Also keep track of the line
# number starting a continued line for warnings.
my $continued_line = '';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/GD/Graph.pm view on Meta::CPAN
$file_name =~ s|/|\%2f|g;
$file_name = $dir."/".$file_name.$$;
my $file = new IO::File "> ".$file_name or
error "Could not open $file_name for writing: $!";
binmode $file;
my $contents = get($url);
error <<EOF unless defined $contents;
Could not retrieve data from: $url
EOF
view all matches for this distribution
view release on metacpan or search on metacpan
t/02plain.t
t/03cgi.t
t/04redirect-plain.t
t/05redirect-cgi.t
t/06die.t
t/07binmode.t
t/08printf.t
t/conf/extra.conf.in
t/perl-bin/binmode.cgi
t/perl-bin/cgi.cgi
t/perl-bin/die.cgi
t/perl-bin/plain.cgi
t/perl-bin/printf.cgi
t/perl-bin/redirect-cgi.cgi
view all matches for this distribution
view release on metacpan or search on metacpan
Htpasswd.pm view on Meta::CPAN
__PACKAGE__ . "::fetchPass - Cannot open $passwdFile: $!";
croak $self->error();
}
}
binmode(FH);
$self->{'OPEN'}++;
$self->_lock() unless $self->{READONLY}; # No lock on r/o
}
#-----------------------------------------------------------#
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/aimcgi.pl view on Meta::CPAN
print "Content-Type: image/$ext\n" ;
print "Connection: close\n" ;
print "Content-Length: $size\n\n" ;
binmode (PIC) ;
binmode (STDOUT) ;
print $buffer while read(PIC, $buffer, 32768);
close PIC ;
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
object will be in. The addfile() method might have been able to read
the file partially before it failed. It is probably wise to discard
or reset the $md5 object if this occurs.
In most cases you want to make sure that the $io_handle is in
C<binmode> before you pass it as argument to the addfile() method.
=item $md5->add_bits($data, $nbits)
=item $md5->add_bits($bitstring)
use Digest::MD5;
my $file = shift || "/etc/passwd";
open(FILE, $file) or die "Can't open '$file': $!";
binmode(FILE);
$md5 = Digest::MD5->new;
while (<FILE>) {
$md5->add($_);
}
use Digest::MD5;
my $file = shift || "/etc/passwd";
open(FILE, $file) or die "Can't open '$file': $!";
binmode(FILE);
print Digest::MD5->new->addfile(*FILE)->hexdigest, " $file\n";
Perl 5.8 support Unicode characters in strings. Since the MD5
algorithm is only defined for strings of bytes, it can not be used on
view all matches for this distribution
view release on metacpan or search on metacpan
my $url = $r->uri;
my $info = $self->fetch_info($file,$mime);
return DECLINED unless $info; # not a legit mp3 file?
my $fh = $self->open_file($file) || return DECLINED;
binmode($fh); # to prevent DOS text-mode foolishness
my $size = -s $file;
my $bitrate = $info->{bitrate};
if ($self->can('bitrate') && $self->bitrate) {
($bitrate = $self->bitrate) =~ s/ kbps//i;
view all matches for this distribution
view release on metacpan or search on metacpan
my $firstline;
if (ref($filename) && UNIVERSAL::isa($filename, 'IO::Handler')) {
my $fh = $filename;
binmode $fh;
sysread($fh, $firstline, 200); # Read 200 bytes. This is a guestimate...
}
else {
eval {
my $fh = *{$filename}{IO};
binmode $fh;
sysread($fh, $firstline, 200); # Read 200 bytes. This is a guestimate...
};
if ($@) {
eval {
open(FH, $filename) or die "Open failed: $!";
binmode FH;
sysread(FH, $firstline, 200); # Read 200 bytes. This is a guestimate...
close FH;
};
if ($@) {
warn "failed? $@\n";
view all matches for this distribution
view release on metacpan or search on metacpan
# my $fh;
# unless(open $fh, '<', $par) {
# print STDERR "unable to read '$par': $!";
# return undef;
# }
# binmode($fh);
# my $md5 = Digest::MD5->new->addfile($fh)->hexdigest;
# my $tmppar = File::Spec->catdir($tmpdir, 'par', $md5);
# close($fh);
warn "[PAR] unpack dir is '$tmppar'\n" if DEBUG;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/PageKit.pm view on Meta::CPAN
sub handler ($$){
my $class = shift;
my ($pk, $model, $status_code);
binmode STDOUT;
$| = 1;
eval {
$pk = $class->new;
$model = $pk->{model};
lib/Apache/PageKit.pm view on Meta::CPAN
# write output_media to file, using process number of Apache child process
my $view_cache_dir = $view->{cache_dir};
my $fo_file = "$view_cache_dir/$$.fo";
my $pdf_file = "$view_cache_dir/$$.pdf";
open FO_TEMPLATE, ">$fo_file" or die "can't open file: $fo_file ($!)";
binmode FO_TEMPLATE;
print FO_TEMPLATE $$output_ref;
close FO_TEMPLATE;
# my $error_message = `$fop_command $fo_file $pdf_file 2>&1 1>/dev/null`;
my $error_message = `$fop_command $fo_file $pdf_file 2>&1`;
lib/Apache/PageKit.pm view on Meta::CPAN
## the errormoessages go also to STDOUT
## and the returncode is always 0
unless ($error_message =~ /^\[ERROR\]:/m){
local $/;
open PDF_OUTPUT, "<$pdf_file" or die "can't open file: $pdf_file ($!)";
binmode PDF_OUTPUT;
$$output_ref = <PDF_OUTPUT>;
close PDF_OUTPUT;
}
else {
die "Error processing template with Apache XML FOP: $error_message";
view all matches for this distribution
view release on metacpan or search on metacpan
ParseFormData.pm view on Meta::CPAN
$name = (split("/", $name))[-1];
$path = join("/", $temp_dir, $name);
$i++;
} until($fh = IO::File->new($path, O_RDWR|O_CREAT|O_EXCL));
defined($fh) or return("Couldn't create temporary file: $path");
binmode($fh);
$fh->autoflush(1);
$data->{values} = [$fh, $path];
return();
}
view all matches for this distribution
view release on metacpan or search on metacpan
Precompress.pm view on Meta::CPAN
else
{
$r->content_encoding('gzip');
$r->send_http_header;
open(FILE, $r->filename . '.gz') || return NOT_FOUND;
binmode(FILE);
while( read(FILE, $buffer, 4096) > 0)
{
$r->print($buffer);
}
close(FILE);
view all matches for this distribution
view release on metacpan or search on metacpan
PrettyPerl.pm view on Meta::CPAN
our @KeyWords =
qw(
while until for foreach unless if elsif else do
package use no require import and or eq ne cmp
abs accept alarm atan2 bind binmode bless
caller chdir chmod chomp chop chown chr
chroot close closedir connect continue cos
crypt dbmclose dbmopen defined delete die
dump each endgrent endhostent endnetent
endprotoent endpwent endservent eof eval
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Roaming.pm view on Meta::CPAN
die "No such file: $file";
}
# return Apache::DECLINED();
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime) = stat _;
my $fh = Symbol::gensym();
if (!open($fh, "<$file") || !binmode($fh)) {
die "Failed to open file $file: $!";
}
$r->set_last_modified($mtime);
$r->content_type('text/plain');
$r->no_cache(1);
lib/Apache/Roaming.pm view on Meta::CPAN
my $fh = Symbol::gensym();
open($fh, ">$file")
or die "Failed to open $file: $!";
binmode($fh)
or die "Failed to request binmode for $file: $!";
my $size = $r->header_in('Content-length');
$r->hard_timeout("Apache->read");
while ($size > 0) {
my $buf = '';
view all matches for this distribution
view release on metacpan or search on metacpan
Scriptor.pm view on Meta::CPAN
$th->{Handlers}{$ext}
or die "$ENV{SCRIPT_NAME}: could not find handlers chain for extension \"$ext\"\n";
# âõîäíîé áóôåð (âíà÷àëå â íåì ñîäåðæèìîå ôàéëà, åñëè äîñòóïíî)
my $input="";
if(open(local *F, $ENV{SCRIPT_FILENAME})) { local ($/,$\); binmode(F); $input=<F>; }
# ïðîõîäèìñÿ ïî âñåì îáðàáîò÷èêàì
my $next=1; # íîìåð ñëåäóþùåãî îáðàáîò÷èêà
my @hands=@{$th->{Handlers}{$ext}};
NoAutoflush() if @hands>1;
view all matches for this distribution
view release on metacpan or search on metacpan
t/Apache-Session-MongoDB.t view on Meta::CPAN
ok( $h2{utf8} eq 'éà èÅ', 'UTF string' );
ok( $h2{'dotted.key'} eq 'test', 'Dotted key' );
ok( $h2{'dollar$key'} eq 'test', 'Dollar key' );
Apache::Session::MongoDB->get_key_from_all_sessions($args);
#binmode(STDERR, ":utf8");
#print STDERR $h2{utf8}."\n";
# Create a few sessions to test deleteIfLowerThan
my @delSessions;
push @delSessions,
view all matches for this distribution