view release on metacpan or search on metacpan
lib/Any/URI/Escape.pm view on Meta::CPAN
Any::URI::Escape - Load URI::Escape::XS preferentially over URI::Escape
=cut
use base 'Exporter';
our @EXPORT = qw( uri_escape uri_unescape );
BEGIN {
eval 'require URI::Escape::XS';
lib/Any/URI/Escape.pm view on Meta::CPAN
$pkg = 'URI::Escape::XS';
}
no strict 'refs';
my $class = __PACKAGE__;
*{"$class\::uri_escape"} = *{"$pkg\::uri_escape"};
*{"$class\::uri_unescape"} = *{"$pkg\::uri_unescape"};
}
1;
=head1 SYNOPSIS
use Any::URI::Escape;
$escaped_url = uri_escape($url);
# URI::Escape::XS will be used instead of URI::Escape if it is installed.
=head1 DESCRIPTION
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyData.pm view on Meta::CPAN
}
$flags->{del_marker} = $del_marker;
$flags->{records} ||= $flags->{data};
$flags->{field_sep} ||= $flags->{sep_char} ||= $flags->{ad_sep_char};
$flags->{quote} ||= $flags->{quote_char} ||= $flags->{ad_quote_char};
$flags->{escape} ||= $flags->{escape_char}||= $flags->{ad_escape_char};
$flags->{record_sep}||= $flags->{eol} ||= $flags->{ad_eol};
# $flags->{skip_first_row}
my $parser = $parser_name->new ($flags);
if ($parser->{col_names} && !$col_names) {
my @cols;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base/Filter.pm view on Meta::CPAN
local $Data::Dumper::Indent = 1;
local $Data::Dumper::Terse = 1;
Data::Dumper::Dumper(@_);
}
sub escape {
$self->assert_scalar(@_);
my $text = shift;
$text =~ s/(\\.)/eval "qq{$1}"/ge;
return $text;
}
view all matches for this distribution
view release on metacpan or search on metacpan
go to https://github.com/aanoaa/AnyEvent-HTTP-ScopedClient/issues for the roadmap and known issues.
0.0.3 Mon Oct 15 14:54:35 2012 KST
- bug fix
- type check before execute callback
- escape character at POD
- fix wrong info README
0.0.2 Thu Oct 11 16:04:29 2012 KST
- independent `AnyEvent::Campfire` for base class
- fixed bug BUILD must return $self
view all matches for this distribution
view release on metacpan or search on metacpan
examples/server.pl view on Meta::CPAN
$log->info("received: $message");
# register who made the request
$requests{$1} = $handle;
# chrome isn't connected
if(not scalar keys %chromi) {
my $reply = "Chromi $1 error " . uri_escape(encode_json({ error => 'chrome not connected'}));
my $frame = Protocol::WebSocket::Frame->new($reply);
$handle->push_write($frame->to_bytes);
}
else {
for my $key (keys %chromi) {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
no warnings 'once';
use JSON;
use AnyEvent::HTTP;
use AnyEvent::CouchDB::Exceptions;
use Data::Dump::Streamer;
use URI::Escape qw( uri_escape uri_escape_utf8 );
use IO::All;
use MIME::Base64;
our $default_json;
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
if (defined($options) && keys %$options) {
for my $name (keys %$options) {
next if ($name eq 'error' || $name eq 'success' || $name eq 'headers');
my $value = $options->{$name};
if ($name eq 'key' || $name eq 'startkey' || $name eq 'endkey') {
$value = uri_escape( $json->encode($value) );
} else {
$value = uri_escape_utf8($value);
}
if ($name eq 'group' || $name eq 'reduce' || $name eq 'descending' || $name eq 'include_docs') {
$value = $value
? ( ($value eq 'false') ? 'false' : 'true' )
: 'false';
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
AnyEvent::CouchDB::Exception::UndefinedDocument->throw(
"An undefined id was passed to open_doc()."
);
}
my ( $cv, $cb ) = cvcb( $options, undef, $self->json_encoder );
my $id = uri_escape_utf8($doc_id);
if ( $id =~ qr{^_design%2F} ) {
$id =~ s{%2F}{/}g;
}
http_request(
GET => $self->uri . $id . $query->($options),
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
$method = 'POST';
$uri = $self->uri;
}
else {
$method = 'PUT';
$uri = $self->uri . uri_escape_utf8( $doc->{_id} );
}
http_request(
$method => $uri . $query->($options),
headers => $self->_build_headers($options),
body => $self->json($doc),
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
my ( $self, $doc, $options ) = @_;
die("Document is missing _id!") unless ( defined $doc->{_id} );
my ( $cv, $cb ) = cvcb( $options, undef, $self->json_encoder );
http_request(
DELETE => $self->uri
. uri_escape_utf8( $doc->{_id} )
. $query->( { rev => $doc->{_rev} } ),
headers => $self->_build_headers($options),
$cb
);
$cv;
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
};
}
my ( $cv, $cb ) = cvcb( $options, 201, $self->json_encoder );
http_request(
PUT => $self->uri
. uri_escape_utf8( $doc->{_id} ) . "/"
. uri_escape_utf8($attachment)
. $query->( { rev => $doc->{_rev} } ),
headers => $self->_build_headers($options),
body => $body,
$cb
);
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
}
};
http_request(
GET => $self->uri
. uri_escape_utf8( $doc->{_id} ) . "/"
. uri_escape_utf8($attachment),
headers => $self->_build_headers($options),
$cb
);
$cv;
}
lib/AnyEvent/CouchDB/Database.pm view on Meta::CPAN
};
}
my ( $cv, $cb ) = cvcb( $options, undef, $self->json_encoder );
http_request(
DELETE => $self->uri
. uri_escape_utf8( $doc->{_id} ) . "/"
. uri_escape_utf8($attachment)
. $query->( { rev => $doc->{_rev} } ),
headers => $self->_build_headers($options),
$cb
);
$cv;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
- Fix bug in where socket handle wasn't being properly
destroyed after use (gh#32)
0.18 2021-10-28 09:18:40 -0600
- Fix test that could fail on some platforms because
regexp wasn't correctly escaped (gh#31)
0.17 2021-07-12 08:43:17 -0600
- Fix bug related to space being in %PATH% on Windows
- Another fix on Perl where test suite could fail if
installed from a different volume than the temp
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base/Filter.pm view on Meta::CPAN
local $Data::Dumper::Indent = 1;
local $Data::Dumper::Terse = 1;
Data::Dumper::Dumper(@_);
}
sub escape {
$self->assert_scalar(@_);
my $text = shift;
$text =~ s/(\\.)/eval "qq{$1}"/ge;
return $text;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Google/PageRank.pm view on Meta::CPAN
return $cb->(undef, {Status => 695, Reason => 'malformed url'}) if $url !~ m[^https?://]i;
my $ch = '6' . WWW::Google::PageRank::_compute_ch_new('info:' . $url);
my $query = 'http://' . ($self->{host}||DEFAULT_HOST) . '/tbr?client=navclient-auto&ch=' . $ch .
'&ie=UTF-8&oe=UTF-8&features=Rank&q=info:' . uri_escape($url);
my $opts = {};
if (ref($self) eq 'HASH') {
# call from rank_get
$opts = $self;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/HTTP/ScopedClient.pm view on Meta::CPAN
if ( 'HASH' eq ref($reqBody) ) {
my @pair;
# push @pair, "$_=$reqBody->{$_}" for ( keys %$reqBody );
push @pair, "$_=" . uri_escape_utf8( $reqBody->{$_} )
for ( keys %$reqBody );
$reqBody = join( '&', @pair );
}
my $sendingData
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/HTTPD/HTTPConnection.pm view on Meta::CPAN
# application/x-www-form-urlencoded
#
# This is the default content type. Forms submitted with this content type must
# be encoded as follows:
#
# 1. Control names and values are escaped. Space characters are replaced by
# `+', and then reserved characters are escaped as described in [RFC1738],
# section 2.2: Non-alphanumeric characters are replaced by `%HH', a percent
# sign and two hexadecimal digits representing the ASCII code of the
# character. Line breaks are represented as "CR LF" pairs (i.e., `%0D%0A').
#
# 2. The control names/values are listed in the order they appear in the
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mail/IMAP/Util.pm view on Meta::CPAN
push @{$stack[-1]}, $1; # let's consider this an atom too
} elsif ($text =~ m/\G[])]/gc) {
pop @stack;
} elsif ($text =~ m/\G\"((?:\\.|[^\"\\])*)\"/gc) {
my $str = $1;
# unescape
$str =~ s/\\\"/\"/g;
$str =~ s/\\\\/\\/g;
push @{$stack[-1]}, $str; # found string
} elsif ($text =~ m/\G(\d+)/gc) {
push @{$stack[-1]}, $1 + 0; # found numeric
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/IRC/Util.pm view on Meta::CPAN
$msg .= defined $trail ? " :$trail" : "";
return $msg;
}
my @_ctcp_lowlevel_escape = ("\000", "0", "\012", "n", "\015", "r", "\020", "\020");
sub unescape_lowlevel {
my ($data) = @_;
my %map = reverse @_ctcp_lowlevel_escape;
$data =~ s/\020(.)/defined $map{$1} ? $map{$1} : $1/ge;
$data
}
sub escape_lowlevel {
my ($data) = @_;
my %map = @_ctcp_lowlevel_escape;
$data =~ s/([\000\012\015\020])/"\020$map{$1}"/ge;
$data
}
sub unescape_ctcp {
my ($data) = @_;
$data =~ s/\\(.)/$1 eq 'a' ? "\001" : ($1 eq "\\" ? "\\" : $1)/eg;
$data
}
sub escape_ctcp {
my ($data) = @_;
$data =~ s/([\\\001])/$1 eq "\001" ? "\\a" : "\\\\"/eg;
$data
}
=item B<decode_ctcp ($data)>
This function decodes CTCP messages contained in an IRC message.
C<$data> should be the last parameter of a IRC PRIVMSG or NOTICE.
It will first unescape the lower layer, extract CTCP messages
and then return a list with two elements: the line without the CTCP messages
and an array reference which contains array references of CTCP messages.
Those CTCP message array references will have the CTCP message tag as
first element (eg. "VERSION") and the rest of the CTCP message as the second
element.
lib/AnyEvent/IRC/Util.pm view on Meta::CPAN
=cut
sub decode_ctcp {
my ($line) = @_;
$line = unescape_lowlevel ($line);
my @ctcp;
while ($line =~ /\G\001([^\001]*)\001/g) {
my $msg = unescape_ctcp ($1);
my ($tag, $data) = split / /, $msg, 2;
push @ctcp, [$tag, $data];
}
$line =~ s/\001[^\001]*\001//g;
# try to parse broken ctcp messages anyway
if ($line =~ s/\001([^\001]*)$//) {
my $msg = unescape_ctcp ($1);
my ($tag, $data) = split / /, $msg, 2;
push @ctcp, [$tag, $data];
}
return ($line, \@ctcp)
lib/AnyEvent/IRC/Util.pm view on Meta::CPAN
=cut
sub encode_ctcp {
my (@args) = @_;
escape_lowlevel (
join "", map {
ref $_
? "\001" . escape_ctcp (join " ", @$_) . "\001"
: $_
} @args
)
}
=item B<filter_colors ($line)>
This function will filter out any mIRC colors and (most) ansi escape sequences.
Unfortunately the mIRC color coding will destroy improper colored numbers. So this
function may destroy the message in some occasions a bit.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/InfluxDB.pm view on Meta::CPAN
required keys C<measurement> and C<fields> and optional C<tags> and C<time>.
Both can be also mixed and matched within an array reference.
Scalar values are expected to be formatted using InfluxDB line protocol.
All special characters need to be escaped. In that case you might want to use
L<InfluxDB::LineProtocol>:
use InfluxDB::LineProtocol qw(dataline);
...
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Impl/POE.pm view on Meta::CPAN
POE cannot guarantee the order of callback invocation for timers, and
usually gets it wrong. That is, if you have two timers, one timing out
after another (all else being equal), the callbacks might be called in
reverse order.
How one manages to even implement stuff that way escapes me.
=item Child watchers
POE offers child watchers - which is a laudable thing, as few event loops
do. Unfortunately, they cannot even implement AnyEvent's simple child
lib/AnyEvent/Impl/POE.pm view on Meta::CPAN
As a workaround, AnyEvent::Impl::POE will take advantage of undocumented
behaviour in POE::Kernel to catch the status of all child processes, but
it cannot guarantee delivery.
How one manages to have such a glaring bug in an event loop after ten
years of development escapes me.
(There are more annoying bugs, for example, POE runs C<waitpid>
unconditionally at finaliser time, so your program will hang until all
child processes have exited.)
view all matches for this distribution