view release on metacpan or search on metacpan
examples/proxy.pl view on Meta::CPAN
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Encode;
use AE;
use AnyEvent::IRC::Server;
use AnyEvent::IRC::Client;
examples/proxy.pl view on Meta::CPAN
my $nick = $msg->{prefix};
$nick =~ s/\!.*$//;
$ircd->daemon_cmd_privmsg(
$nick => $channel,
encode('utf8', Lingua::JA::Gal->gal(decode('utf8',$message))),
);
}
);
$ic->send_srv( 'JOIN', '#yokohama.pm' );
$ic->connect(
view all matches for this distribution
view release on metacpan or search on metacpan
t/08_idna.t view on Meta::CPAN
use utf8;
use AnyEvent::Util;
use Test::More;
plan skip_all => 'TODO';
view all matches for this distribution
view release on metacpan or search on metacpan
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
view release on metacpan or search on metacpan
inc/Module/Install/TestBase.pm view on Meta::CPAN
$self->requires('Filter::Util::Call');
}
1;
=encoding utf8
#line 70
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/TestBase.pm view on Meta::CPAN
$self->requires('Filter::Util::Call');
}
1;
=encoding utf8
#line 70
view all matches for this distribution
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
view release on metacpan or search on metacpan
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
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
view release on metacpan or search on metacpan
lib/AnyEvent/MCP.pm view on Meta::CPAN
=item $class = AnyEvent::MCP::json_class
Returns C<JSON::XS> if available, otherwise C<JSON::PP>. The caller
configures a new coder instance as needed.
=item $bytes = AnyEvent::MCP::utf8enc $text
Return a UTF-8 byte string for C<$text>, leaving the argument unchanged.
=item $text = AnyEvent::MCP::utf8dec $bytes
Decode a UTF-8 byte string into characters, dying on invalid UTF-8.
The argument is left unchanged. For intentional in-place conversions,
use Perl's C<utf8::encode> or C<utf8::decode> directly.
=item $bytes = AnyEvent::MCP::random_bytes $length
Returns exactly C<$length> random bytes. Tries C</dev/urandom>, then an external
C<openssl rand> command. No additional random-number module is required.
lib/AnyEvent/MCP.pm view on Meta::CPAN
sub json_class {
our $JSON_CLASS ||= eval { require JSON::XS; "JSON::XS" }
|| do { require JSON::PP; "JSON::PP" };
}
sub utf8enc($) {
my $text = shift;
utf8::encode $text;
$text
}
sub utf8dec($) {
my $bytes = shift;
utf8::decode $bytes
or die "invalid UTF-8\n";
$bytes
}
sub instance_name {
lib/AnyEvent/MCP.pm view on Meta::CPAN
local $/;
my $bytes = <$fh>;
defined $bytes or die "$file: $!\n";
close $fh or die "$file: $!\n" if $close;
utf8dec $bytes
}
sub file_save {
my ($file, $text) = @_;
file_replace $file, utf8enc $text
}
sub random_bytes($) {
my ($length) = @_;
view all matches for this distribution
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
view release on metacpan or search on metacpan
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
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
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
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
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
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
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
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
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