Result:
found more than 545 distributions - search limited to the first 2001 files matching your query ( run in 1.029 )



AnyEvent-Kanye

 view release on metacpan or  search on metacpan

lib/AnyEvent/Kanye.pm  view on Meta::CPAN

package AnyEvent::Kanye;

use strict;
use warnings;

use utf8;

use AnyEvent ();
use Lingua::EN::Inflect qw(PL);

BEGIN { our @ISA = "AnyEvent::CondVar" }

 view all matches for this distribution


AnyEvent-LeapMotion

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN


use 5.008_001;

use strict;
use warnings;
use utf8;

use Module::Build;
use File::Basename;
use File::Spec;
use CPAN::Meta;

 view all matches for this distribution


AnyEvent-Lingr

 view release on metacpan or  search on metacpan

eg/lingr-stream.pl  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;
use utf8;

binmode STDOUT, ':utf8';

use AnyEvent;
use AnyEvent::Lingr;

use Config::Pit;

 view all matches for this distribution


AnyEvent-MP

 view release on metacpan or  search on metacpan

MP/Config.pm  view on Meta::CPAN


sub load {
   if (open my $fh, "<:raw", $CONFIG_FILE) {
      return if eval {
         local $/;
         %CFG = %{ JSON::XS->new->utf8->relaxed->decode (scalar <$fh>) };
         1
      };
   }

   %CFG = (

MP/Config.pm  view on Meta::CPAN

   return unless delete $CFG{dirty};

   open my $fh, ">:raw", "$CONFIG_FILE~new~"
      or Carp::croak "$CONFIG_FILE~new~: $!";

   syswrite $fh, JSON::XS->new->pretty->utf8->encode (\%CFG) . "\n"
      or Carp::croak "$CONFIG_FILE~new~: $!";

   close $fh
      or Carp::croak "$CONFIG_FILE~new~: $!";

 view all matches for this distribution


AnyEvent-MPV

 view release on metacpan or  search on metacpan

MPV.pm  view on Meta::CPAN

sub OBSID() { 2**52 }

our $JSON = eval { require JSON::XS; JSON::XS:: }
          || do  { require JSON::PP; JSON::PP:: };

our $JSON_ENCODER = $JSON->new->utf8;
our $JSON_DECODER = $JSON->new->latin1;

our $mpv_path; # last mpv path used
our $mpv_optionlist; # output of mpv --list-options

 view all matches for this distribution


AnyEvent-Mac-Pasteboard

 view release on metacpan or  search on metacpan

t/02_changing.t  view on Meta::CPAN

use strict;
use warnings;
use lib qw(lib);
use utf8;

use constant TEST_COUNT => 4;

use Test::More tests => TEST_COUNT;

t/02_changing.t  view on Meta::CPAN

use AnyEvent::Mac::Pasteboard ();
use Encode;
use File::Temp;
use Time::HiRes;

binmode STDOUT, ':utf8';
binmode STDERR, ':utf8';

my $cv = AE::cv;

my @dictionary = (qw(FINE ☀ ☁ CLOUD RAIN ☂ ☃ ☆ ★ ♬ ♪ ♫));

 view all matches for this distribution


AnyEvent-Memcached

 view release on metacpan or  search on metacpan

lib/AnyEvent/Memcached.pm  view on Meta::CPAN

	}
}

sub _do {
	my $self    = shift;
	my $key     = shift; utf8::decode($key) xor utf8::encode($key) if utf8::is_utf8($key);
	my $command = shift; utf8::decode($command) xor utf8::encode($command) if utf8::is_utf8($command);
	my $worker  = shift; # CODE
	my %args    = @_;
	my $servers = $self->{hash}->servers($key);
	my %res;
	my %err;

 view all matches for this distribution


AnyEvent-MessagePack

 view release on metacpan or  search on metacpan

lib/AnyEvent/MessagePack.pm  view on Meta::CPAN

});

1;
__END__

=encoding utf8

=head1 NAME

AnyEvent::MessagePack - MessagePack stream serializer/deserializer for AnyEvent

 view all matches for this distribution


AnyEvent-Monitor-CPU

 view release on metacpan or  search on metacpan

lib/AnyEvent/Monitor/CPU.pm  view on Meta::CPAN


1;

__END__

=encoding utf8

=head1 NAME

AnyEvent::Monitor::CPU - monitors your process CPU usage, with high/low watermark triggers

 view all matches for this distribution


AnyEvent-MultiDownload

 view release on metacpan or  search on metacpan

lib/AnyEvent/MultiDownload.pm  view on Meta::CPAN

#!/usr/bin/perl
package AnyEvent::MultiDownload;
use strict;
use utf8;
use Moo;
use AE;
use Asset::File;
use AnyEvent::Digest;
use List::Util qw/shuffle/;

lib/AnyEvent/MultiDownload.pm  view on Meta::CPAN


__END__

=pod
 
=encoding utf8

=head1 NAME

AnyEvent::MultiDownload - 非阻塞的多线程多地址文件下载的模块

 view all matches for this distribution


AnyEvent-MySQL-ConnPool

 view release on metacpan or  search on metacpan

lib/AnyEvent/MySQL/ConnPool.pm  view on Meta::CPAN

        sub {
            my($dbh) = @_;
            if( $dbh ) {
                warn "Connect success!";
                $dbh->pre_do("set names latin1");
                $dbh->pre_do("set names utf8");
            }
            else {
                warn "Connect fail: $AnyEvent::MySQL::errstr ($AnyEvent::MySQL::err)";
                $end->send;
            }

 view all matches for this distribution


AnyEvent-MySQL

 view release on metacpan or  search on metacpan

lib/AnyEvent/MySQL.pm  view on Meta::CPAN


use 5.006;
use strict;
use warnings;

=encoding utf8

=head1 NAME

AnyEvent::MySQL - Pure Perl AnyEvent socket implementation of MySQL client

lib/AnyEvent/MySQL.pm  view on Meta::CPAN

    my $dbh = AnyEvent::MySQL->connect("DBI:mysql:database=test;host=127.0.0.1;port=3306", "ptest", "pass", { PrintError => 1 }, sub {
        my($dbh) = @_;
        if( $dbh ) {
            warn "Connect success!";
            $dbh->pre_do("set names latin1");
            $dbh->pre_do("set names utf8");
        }
        else {
            warn "Connect fail: $AnyEvent::MySQL::errstr ($AnyEvent::MySQL::err)";
            $end->send;
        }

lib/AnyEvent/MySQL.pm  view on Meta::CPAN

    or tried but failed.

    If failed, the $dbh in the $cb's args will be undef.

    You can do some connection initialization here, such as
     set names utf8;

    But you should NOT rely on this for work flow control,
    cause the reconnection can occur anytime.

=cut

 view all matches for this distribution


AnyEvent-Net-Curl-Queued

 view release on metacpan or  search on metacpan

eg/CrawlApache.pm  view on Meta::CPAN

package CrawlApache;
use strict;
use utf8;
use warnings qw(all);
use feature qw(say);

use Moo;
use MooX::Types::MooseLike::Base qw(InstanceOf);

 view all matches for this distribution



AnyEvent-Pg-Pool-Multiserver

 view release on metacpan or  search on metacpan

example/ex.pl  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;
use utf8;
use v5.10;

use lib 'lib';

use AnyEvent;

 view all matches for this distribution


AnyEvent-Plackup

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN


use 5.008_001;

use strict;
use warnings;
use utf8;

use Module::Build;
use File::Basename;
use File::Spec;
use CPAN::Meta;

 view all matches for this distribution


AnyEvent-Redis-RipeRedis

 view release on metacpan or  search on metacpan

lib/AnyEvent/Redis/RipeRedis.pm  view on Meta::CPAN


our $VERSION = '1.62';

use AnyEvent;
use AnyEvent::Handle;
use Encode qw( find_encoding is_utf8 );
use Scalar::Util qw( looks_like_number weaken );
use Digest::SHA qw( sha1_hex );
use Carp qw( croak );

my %ERROR_CODES;

lib/AnyEvent/Redis/RipeRedis.pm  view on Meta::CPAN

  my $cmd_str = '';
  foreach my $token ( $cmd->{kwd}, @{ $cmd->{args} } ) {
    unless ( defined $token ) {
      $token = '';
    }
    elsif ( defined $self->{encoding} && is_utf8( $token ) ) {
      $token = $self->{encoding}->encode( $token );
    }
    $cmd_str .= '$' . length( $token ) . EOL . $token . EOL;
  }
  $cmd_str = '*' . ( scalar( @{ $cmd->{args} } ) + 1 ) . EOL . $cmd_str;

lib/AnyEvent/Redis/RipeRedis.pm  view on Meta::CPAN

    lazy                   => 1,
    connection_timeout     => 5,
    read_timeout           => 5,
    reconnect              => 1,
    min_reconnect_interval => 5,
    encoding               => 'utf8',

    on_connect => sub {
      # handling...
    },

 view all matches for this distribution


AnyEvent-Redis

 view release on metacpan or  search on metacpan

lib/AnyEvent/Redis.pm  view on Meta::CPAN

  use AnyEvent::Redis;

  my $redis = AnyEvent::Redis->new(
      host => '127.0.0.1',
      port => 6379,
      encoding => 'utf8',
      on_error => sub { warn @_ },
      on_cleanup => sub { warn "Connection closed: @_" },
  );

  # callback based

lib/AnyEvent/Redis.pm  view on Meta::CPAN

Optional.  The server port.

=item encoding => <ENCODING>

Optional.  Encode and decode data (when storing and retrieving, respectively)
according to I<ENCODING> (C<"utf8"> is recommended or see L<Encode::Supported>
for details on possible I<ENCODING> values).

Omit if you intend to handle raw binary data with this connection.

=item on_error => $cb->($errmsg)

 view all matches for this distribution



AnyEvent-RipeRedis-Cluster

 view release on metacpan or  search on metacpan

lib/AnyEvent/RipeRedis/Cluster.pm  view on Meta::CPAN

  $self->{on_node_disconnect} = $params{on_node_disconnect};
  $self->{on_node_error}      = $params{on_node_error};
  $self->on_error( $params{on_error} );

  my %node_params;
  foreach my $name ( qw( password utf8 connection_timeout read_timeout
      reconnect reconnect_interval handle_params ) )
  {
    next unless defined $params{$name};
    $node_params{$name} = $params{$name};
  }

lib/AnyEvent/RipeRedis/Cluster.pm  view on Meta::CPAN

}

sub crc16 {
  my $data = shift;

  unless ( utf8::downgrade( $data, 1 ) ) {
    utf8::encode($data);
  }

  my $crc = 0;
  foreach my $char ( split //, $data ) {
    $crc = ( $crc << 8 & 0xff00 )

lib/AnyEvent/RipeRedis/Cluster.pm  view on Meta::CPAN


If enabled, the client will try to send read-only commands to slave nodes.

Disabled by default.

=item utf8 => $boolean

If enabled, all strings will be converted to UTF-8 before sending to nodes,
and all results will be decoded from UTF-8.

Enabled by default.

 view all matches for this distribution


AnyEvent-RipeRedis

 view release on metacpan or  search on metacpan

lib/AnyEvent/RipeRedis.pm  view on Meta::CPAN

  $self->{host} = $params{host} || D_HOST;
  $self->{port} = $params{port} || D_PORT;
  $self->{password} = $params{password};
  $self->{database}
      = defined $params{database} ? $params{database} : D_DB_INDEX;
  $self->{utf8}          = exists $params{utf8} ? $params{utf8} : 1;
  $self->{lazy}          = $params{lazy};
  $self->{reconnect}     = exists $params{reconnect} ? $params{reconnect} : 1;
  $self->{handle_params} = $params{handle_params} || {};
  $self->{on_connect}    = $params{on_connect};
  $self->{on_disconnect} = $params{on_disconnect};

lib/AnyEvent/RipeRedis.pm  view on Meta::CPAN


      return $self->{$name};
    };
  }

  foreach my $name ( qw( utf8 reconnect on_connect on_disconnect ) ) {
    *{$name} = sub {
      my $self = shift;

      if (@_) {
        $self->{$name} = shift;

lib/AnyEvent/RipeRedis.pm  view on Meta::CPAN

          return;
        }

        $reply = substr( $handle->{rbuf}, 0, $str_len, '' );
        substr( $handle->{rbuf}, 0, EOL_LENGTH, '' );
        if ( $self->{utf8} ) {
          utf8::decode($reply);
        }

        undef $str_len;
      }
      else {

lib/AnyEvent/RipeRedis.pm  view on Meta::CPAN

  my @tokens  = ( @{ $cmd->{kwds} }, @{ $cmd->{args} } );
  foreach my $token (@tokens) {
    unless ( defined $token ) {
      $token = '';
    }
    elsif ( $self->{utf8} ) {
      utf8::encode($token);
    }
    $cmd_str .= '$' . length($token) . EOL . $token . EOL;
  }
  $cmd_str = '*' . scalar(@tokens) . EOL . $cmd_str;

lib/AnyEvent/RipeRedis.pm  view on Meta::CPAN

connection by using C<SELECT> command. The client remembers last selected
database after reconnection and switches to it automaticaly.

The default database index is C<0>.

=item utf8 => $boolean

If enabled, all strings will be converted to UTF-8 before sending to
the server, and all results will be decoded from UTF-8.

Enabled by default.

lib/AnyEvent/RipeRedis.pm  view on Meta::CPAN


=head2 database()

Gets selected database index.

=head2 utf8( [ $boolean ] )

Enables or disables UTF-8 mode.

=head2 connection_timeout( [ $fractional_seconds ] )

 view all matches for this distribution


AnyEvent-SKKServ

 view release on metacpan or  search on metacpan

lib/AnyEvent/SKKServ.pm  view on Meta::CPAN

}

1;
__END__

=encoding utf8

=head1 NAME

AnyEvent::SKKServ - Lightweight skkserv implementation for AnyEvent

 view all matches for this distribution


AnyEvent-SSH2

 view release on metacpan or  search on metacpan

lib/AnyEvent/SSH2.pm  view on Meta::CPAN

1;
__END__

=pod
 
=encoding utf8

=head1 NAME

AnyEvent::SSH2 - 基于 AnyEvent 的 SSH2 的非阻塞事件驱动的实现

 view all matches for this distribution


AnyEvent-STOMP-Client

 view release on metacpan or  search on metacpan

lib/AnyEvent/STOMP/Client.pm  view on Meta::CPAN

    unless ($self->is_connected or $command eq 'CONNECT') {
        croak "Have you considered connecting to a STOMP broker first before "
            ."trying to send something?";
    }

    utf8::encode($command);

    my $header;
    if ($command eq 'CONNECT') {
        $header = header_hash2string($header_hashref);
    }
    else {
        $header = header_hash2string(encode_header($header_hashref));
    }
    utf8::encode($header);

    my $frame;
    if ($command eq 'SEND') {
        $body = '' unless defined $body;
        $frame = $command.$EOL.$header.$EOL.$EOL.$body.$NULL;

 view all matches for this distribution


AnyEvent-SparkBot

 view release on metacpan or  search on metacpan

lib/AnyEvent/HTTP/Spark.pm  view on Meta::CPAN

use MooX::Types::MooseLike::Base qw(:all);
use Data::Dumper;
use JSON qw(to_json from_json);
use HTTP::Request::Common qw(POST);
use Ref::Util qw(is_plain_arrayref is_plain_hashref);
use URI::Escape qw(uri_escape_utf8);
use namespace::clean;
use Scalar::Util qw(looks_like_number);
use AnyEvent;

BEGIN { 

lib/AnyEvent/HTTP/Spark.pm  view on Meta::CPAN


  my $headers=$self->default_headers;

  my @args;
  while(my ($key,$value)=splice @list,0,2) {
    push @args,uri_escape_utf8($key).'='.uri_escape_utf8($value);
  }
  my $args=join '&',@args;
  $uri .=$args;

  my $get=new HTTP::Request(GET=>$uri,$self->default_headers);

lib/AnyEvent/HTTP/Spark.pm  view on Meta::CPAN

  my $headers=$self->default_headers;


  my @args;
  while(my ($key,$value)=splice @list,0,2) {
    push @args,uri_escape_utf8($key).'='.uri_escape_utf8($value);
  }
  my $args=join '&',@args;
  $uri .=$args;

  my $get=new HTTP::Request(HEAD=>$uri,$self->default_headers);

lib/AnyEvent/HTTP/Spark.pm  view on Meta::CPAN


  my $headers=$self->default_headers;

  my @args;
  while(my ($key,$value)=splice @list,0,2) {
    push @args,uri_escape_utf8($key).'='.uri_escape_utf8($value);
  }
  my $args=join '&',@args;
  $uri .=$args;

  my $get=new HTTP::Request(DELETE=>$uri,$self->default_headers);

 view all matches for this distribution


AnyEvent-Sub-Retry

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN


use 5.008_001;

use strict;
use warnings;
use utf8;

use Module::Build;
use File::Basename;
use File::Spec;
use CPAN::Meta;

 view all matches for this distribution


AnyEvent-Superfeedr

 view release on metacpan or  search on metacpan

eg/print_feed_titles.pl  view on Meta::CPAN

use AnyEvent::Superfeedr;
use Encode;

die "$0 <jid> <pass>" unless @ARGV >= 2;

binmode STDOUT, ":utf8";

my $end = AnyEvent->condvar;
my $sf = AnyEvent::Superfeedr->new(
    debug => $ENV{DEBUG},
    jid => shift,

eg/print_feed_titles.pl  view on Meta::CPAN

        my $notification = shift;
        warn $notification->as_xml;
        printf "%s: %s\n", $notification->title, $notification->feed_uri;

        for my $entry ($notification->entries) {
            my $title = Encode::decode_utf8($entry->title); 
            $title =~ s/\s+/ /gs;

            my $l = length $title;
            my $max = 50;
            if ($l > $max) {

 view all matches for this distribution


AnyEvent-Sway

 view release on metacpan or  search on metacpan

lib/AnyEvent/Sway.pm  view on Meta::CPAN

}

=head2 $sway->message($type, $content)

Sends a message of the specified C<type> to Sway, possibly containing the data
structure C<content> (or C<content>, encoded as utf8, if C<content> is a
scalar), if specified.

    my $reply = $sway->message(TYPE_RUN_COMMAND, "reload")->recv;
    if ($reply->{success}) {
        say "Configuration successfully reloaded";

lib/AnyEvent/Sway.pm  view on Meta::CPAN


    my $payload = "";
    if ($content) {
        if (not ref($content)) {
            # Convert from Perl’s internal encoding to UTF8 octets
            $payload = encode_utf8($content);
        } else {
            $payload = encode_json $content;
        }
    }
    my $message = $magic . pack("LL", length($payload), $type) . $payload;

 view all matches for this distribution


AnyEvent-Task

 view release on metacpan or  search on metacpan

lib/AnyEvent/Task/Server/Worker.pm  view on Meta::CPAN

  my ($server, $fh, $monitor_fh) = @_;

  AnyEvent::Util::fh_nonblocking $fh, 0;
  AnyEvent::Util::fh_nonblocking $monitor_fh, 0;

  $json = JSON::XS->new->utf8;

  $sel = IO::Select->new;
  $sel->add($fh, $monitor_fh);

  while(1) {

 view all matches for this distribution


( run in 1.029 second using v1.01-cache-2.11-cpan-49f99fa48dc )