view release on metacpan or search on metacpan
XS/CQuery.pod view on Meta::CPAN
to the latter.
=head1 KNOWN BUGS
Objects should be transparently encoded/decoded to and from perl hash representations.
=head1 SEE ALSO
perl(1),
DDC::XS(3perl),
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DDCCI.pm view on Meta::CPAN
# create a new object, using first found monitor
my $ddcci = DDCCI->new($monitors->[0]->{'dev'});
# get monitor EDID and decode it
my $edid = $ddcci->read_edid();
my $decoded = decode_edid($edid);
print "id: $decoded->{'id'}, s/n: $decoded->{'sn'}, type: $decoded->{'type'}\n";
# get monitor capabilities (from the firmware)
my $caps = $ddcci->read_caps();
print "Monitor capabilities: $cap\n";
view all matches for this distribution
view release on metacpan or search on metacpan
my $data = decode_djson $djson_string;
DESCRIPTION
DJSON is a data language that is simlar to JSON, just more chill. All
valid JSON is also valid DJSON (and represents the same thing when
decoded), but DJSON lets you omit a lot of the syntax that makes JSON a
pain to write.
DJSON SYNTAX
Here is some examples of DJSON followed by equivalent JSON:
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/djabberd-test.pl view on Meta::CPAN
warn "challenge response: [$challenge]\n" if $ENV{TESTDEBUG};
die "Didn't get expected response: $challenge" unless $challenge =~ /challenge|success\b/;
if ($challenge =~ s/^.*>(.+)<.*$/$1/sm) {
$challenge = decode_base64($challenge);
warn "decoded challenge: [$challenge]\n" if $ENV{TESTDEBUG};
}
my $response = $conn->client_step($challenge);
if ($conn->is_success) {
$got_success_already = 1;
view all matches for this distribution
view release on metacpan or search on metacpan
src/dmidecode.c view on Meta::CPAN
data=next;
i++;
}
if(i!=num)
printf("Wrong DMI structures count: %d announced, only %d decoded.\n",
num, i);
if(data-buf!=len)
printf("Wrong DMI structures length: %d bytes announced, structures occupy %d bytes.\n",
len, (unsigned int)(data-buf));
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DMTF/CIM/WSMan.pm view on Meta::CPAN
}
$ret .= "<p:".($prop->name).">".$val."</p:".($prop->name).">";
}
}
else {
my $decoded;
if(ref($val) eq 'ARRAY') {
$decoded=join('',@{$val});
}
else {
$decoded=$val;
}
$ret .= "<p:".($prop->name).">".encode_base64($decoded)."</p:".($prop->name).">";
}
}
elsif(ref($val) eq 'ARRAY') {
foreach my $value (@$val) {
if($prop->is_ref) {
lib/DMTF/CIM/WSMan.pm view on Meta::CPAN
&& defined $model->{qualifiers}{octetstring}
&& $model->{qualifiers}{octetstring} eq 'true') {
if(defined $model->{type}
&& $model->{type} eq 'uint8'
&& defined $model->{array}) {
my $decoded=decode_base64($twig->text);
return wantarray ? ($decoded, 'bytes') : $decoded;
}
if(defined $model->{type}
&& $model->{type} eq 'string'
&& defined $model->{array}) {
my $encoded=$twig->text;
view all matches for this distribution
view release on metacpan or search on metacpan
contrib/spamtrap view on Meta::CPAN
=item B<Understands various forms of complex complaints>
When deployed in an address used by users to report spam, will attempt
to find the spam headers within attachments, possibly including
decoded uuencoded and base64 parts. Multiple header sets can be
analyzed in a single complaint, which will be archived separatedly.
=item B<Keeps an index of spam samples>
An external index, maintained with L<MLDBM>, L<Storable> and
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DNS/NIOS/Response.pm view on Meta::CPAN
sub content {
my $self = shift;
my $h;
try {
$h = from_json( $self->_http_response->decoded_content );
}
catch {
$h = $self->_http_response->decoded_content;
# For some reason <5.28 returns a quoted string during test
$h =~ s/^"|"$//g;
};
return $h;
lib/DNS/NIOS/Response.pm view on Meta::CPAN
Wether the request was successful
=head2 content
Response content as hashref. If the content for some reason cannot be converted,
it will return the decoded_content as is.
=head2 json
Return a json string.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DNS/PunyDNS.pm view on Meta::CPAN
my $req = new HTTP::Request( 'GET', $url );
my $response = $ua->request($req);
if ( $response->is_success ) {
my $content = $response->content;
my $decoded_content = XMLin( \$content, KeyAttr => 'domain' );
if ( $decoded_content->{'error'} ) {
$self->{'error'} = $decoded_content->{'error'};
}
return $decoded_content;
} else {
die "There was a problem with the request\n" . $response->status_line;
}
} ## end sub _get_it
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DNS/Unbound.pm view on Meta::CPAN
B<NOTE:> Consider parsing L<DNS::Unbound::Result>âs C<answer_packet()>
as a more robust, albeit heavier, way to parse query result data.
L<Net::DNS::Packet> and L<AnyEvent::DNS>âs C<dns_unpack()> are two good
ways to parse DNS packets.
=head2 $decoded = decode_name($encoded)
Decodes a DNS name. Useful for, e.g., C<NS>, C<CNAME>, and C<PTR> query
results.
Note that this functionâs return will normally include a trailing C<.>
view all matches for this distribution
view release on metacpan or search on metacpan
0.62 2012-04-29T10:56:44Z
- Add SnmpCpeAccessControl to Syminfo Contributor: Elliot
0.61 2011-10-03T21:58:40Z
- Fix RT70882: ServiceClassName need to be zero-terminated This is
optional in input data structure and removed/not visible in decoded tree
either
0.6004 2010-09-12T21:51:02Z
- Fix #61267: Encode::int() fails on 64b systems: 1234567890 >> 8 ==
72057594033105405 != 11954685
view all matches for this distribution
view release on metacpan or search on metacpan
mp_check_array(const char *cur, const char *end);
/**
* \brief Decode an array header from MsgPack \a data.
*
* All array members must be decoded after the header.
* \param data - the pointer to a buffer
* \return the number of elements in an array
* \post *data = *data + mp_sizeof_array(retval)
* \sa \link mp_encode_array() An usage example \endlink
*/
mp_check_map(const char *cur, const char *end);
/**
* \brief Decode a map header from MsgPack \a data.
*
* All map key-value pairs must be decoded after the header.
* \param data - the pointer to a buffer
* \return the number of key/value pairs in a map
* \post *data = *data + mp_sizeof_array(retval)
* \sa \link mp_encode_map() An usage example \endlink
*/
/**
* \brief Decode a string from MsgPack \a data
* \param data - the pointer to a buffer
* \param len - the pointer to save a string length
* \return a pointer to a decoded string
* \post *data = *data + mp_sizeof_str(*len)
* \sa mp_encode_binl
*/
MP_PROTO const char *
mp_decode_str(const char **data, uint32_t *len);
/**
* \brief Decode a binstring from MsgPack \a data
* \param data - the pointer to a buffer
* \param len - the pointer to save a binstring length
* \return a pointer to a decoded binstring
* \post *data = *data + mp_sizeof_str(*len)
* \sa mp_encode_binl
*/
MP_PROTO const char *
mp_decode_bin(const char **data, uint32_t *len);
mp_check_bool(const char *cur, const char *end);
/**
* \brief Decode a bool value from MsgPack \a data
* \param data - the pointer to a buffer
* \return a decoded bool value
* \post *data = *data + mp_sizeof_bool(retval)
*/
MP_PROTO bool
mp_decode_bool(const char **data);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DR/SunDown.pm view on Meta::CPAN
# $string and $data have the same utf8 flag
my $string = markdown2html $data;
utf8::decode( $data ) if utf8::is_utf8( $data );
# $string is decoded utf8
my $string = markdown2html $data;
=head1 DESCRIPTION
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DR/Tarantool/Spaces.pm view on Meta::CPAN
The standard L<Tarantool|http://tarantool.org> types.
=item UTF8STR
The same as B<STR>, but the string is utf8-decoded
after it's received from the server.
=item INT & INT64
The same as B<NUM> and B<NUM64>, but contain signed values.
=item JSON
The field is encoded with L<JSON::XS> when putting
into a database, and decoded after is received back
from the server.
=back
=head1 METHODS
view all matches for this distribution
view release on metacpan or search on metacpan
t/010-tarantool-1.5/010-dr-tqueue.t view on Meta::CPAN
"urgent(data => arrayref)";
my $task5_t = $q->take(tube => 'utftube');
my $task4_t = $q->take(tube => 'utftube');
is_deeply $task4->data, $task4_t->data, 'Task and decoded utf data';
is_deeply $task5->data, $task5_t->data, 'Task and encoded utf data';
SKIP: {
my $task_unique1 = eval {
$q->put_unique(tube => 'utftube_unique',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DR/Tnt.pm view on Meta::CPAN
(L<DR::Tnt::Client::Coro> and L<DR::Tnt::Client::Sync>).
=item utf8
Default value is C<TRUE>. If C<TRUE>, driver will unpack all
strings as C<utf8>-decoded strings.
=back
=head2 Information attributes
view all matches for this distribution
view release on metacpan or search on metacpan
CAB/Format/XmlRpc.pm view on Meta::CPAN
## $fmt = CLASS_OR_OBJ->new(%args)
## + object structure:
## (
## ##-- input
## rxprs => $rpc_parser, ##-- RPC::XML::Parser object
## rxdata => $rpc_data, ##-- structured data as decoded by RPC::XML::Parser
##
## ##-- output
## docbuf => $doc, ##-- DTA::CAB::Document output buffer
## xprs => $xml_parser, ##-- XML::LibXML parser object
## level => $formatLevel, ##-- format level
CAB/Format/XmlRpc.pm view on Meta::CPAN
%args, %$fmt:
##-- input
rxprs => $rpc_parser, ##-- RPC::XML::Parser object
rxdata => $rpc_data, ##-- structured data as decoded by RPC::XML::Parser
##
##-- output
docbuf => $doc, ##-- DTA::CAB::Document output buffer
xprs => $xml_parser, ##-- XML::LibXML parser object
level => $formatLevel, ##-- format level
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Daemonise/Plugin/HipChat.pm view on Meta::CPAN
notify => $notify_users || 0,
color => $colour,
});
unless ($res->is_success) {
$self->log($res->status_line . ': ' . $res->decoded_content);
}
# exit; # async
return;
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Daizu/Feed.pm view on Meta::CPAN
if ($format eq 'atom') { # Atom 1.0
$feed = $doc->createElementNS($ATOM_NS, 'feed');
$entry_parent = $feed;
add_xml_elem($feed, title => $feed_title);
# TODO - description should be decoded from utf-8 at some point
add_xml_elem($feed, subtitle => $file->{description})
if defined $file->{description};
add_xml_elem($feed, id => $file->guid_uri);
add_xml_elem($feed, generator => 'Daizu CMS',
uri => 'http://www.daizucms.org/',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/Auth/Github.pm view on Meta::CPAN
state => $state_received
]);
die "error while fetching: ", $resp->status_line
unless $resp->is_success;
my %querystr = parse_query_str($resp->decoded_content);
my $acc = $querystr{access_token};
if($acc) {
my $jresp = $browser->get("https://api.github.com/user?access_token=$acc");
my $json = decode_json($jresp->decoded_content);
session 'github_user' => $json;
session 'github_access_token' => $acc;
#session 'logged_in' => true;
redirect $github_auth_success;
return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/Auth/Google.pm view on Meta::CPAN
redirect_uri => $callback_url,
grant_type => 'authorization_code',
}
);
my ($data, $error) = _parse_response( $res->decoded_content );
if (ref $data && !$error) {
# Google tells us to ignore any unrecognized fields
# included in the response (like their "id_token").
$data = {
access_token => $data->{access_token},
lib/Dancer/Plugin/Auth/Google.pm view on Meta::CPAN
'https://www.googleapis.com/oauth2/v2/userinfo',
[ 'Authorization' => 'Bearer ' . $data->{access_token} ],
);
my $user;
($user, $error) = _parse_response( $res->decoded_content );
return send_error("google auth: $error") if $error;
if (exists $user->{verified_email}) {
# we stringify our JSON::Bool data as some session
# backends might have trouble storing objects.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/DynamicConfig.pm view on Meta::CPAN
the data, and only re-read it when the file's mtime has changed.
=head2 The rewrite_class
This class, if provided, must implement one class method, C<rewrite()>, which
takes the decoded data structure represented by the file's contents.
C<rewrite()> may then return any data structure it likes, and this structure
will be passed back as the return value of C<dynamic_config()>.
=head2 Filetypes
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/EncodeID.pm view on Meta::CPAN
#print STDERR "Decoded: '$text'\n";
$cleartext .= $text;
};
if (defined $prefix) {
## Ensure the decoded ID contains the prefix
my $i = index $cleartext,$prefix;
if ($i != 0) {
die "Invalid Hash-ID value ($orig_encoded_id) - bad prefix" ;
}
#skip the prefix;
lib/Dancer/Plugin/EncodeID.pm view on Meta::CPAN
=head1 FUNCTIONS
C<encode_id(ID [,PREFIX])> - Encodes the given ID, returns the encoded hash value.
If "PREFIX" is given, it will be added to the ID before encoding.
It can be used when decoding to verify the decoded value is valid.
C<decode_id(ID [,PREFIX])> - Decodes the given ID, returns the original (cleartext) ID value.
If "PREFIX" is given, it will be used to verify the validity of the ID.
=head1 DESCRIPTION
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/SimpleLexicon.pm view on Meta::CPAN
The value of the default language. If not specified, and the looking up
in the above values fails, no translation will be done.
=head2 encoding
The string returned by maketext will be decoded using
this encoding. By default is C<UTF-8>.
To disable the decoding, set it to C<raw>.
=head1 EXPORT
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CORION/Apache/Tika/Connection/LWP.pm view on Meta::CPAN
my $p = deferred;
my ( $code, $response ) = $self->process_response(
$res->request, # request
$res->code, # code
$res->message, # msg
$res->decoded_content, # body
$res->headers # headers
);
$p->resolve( $code, $response );
$p->promise
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Request.pm view on Meta::CPAN
$new_request->{params} = $new_params;
$new_request->{_body_params} = $request->{_body_params};
$new_request->{_query_params} = $request->{_query_params};
$new_request->{_route_params} = $request->{_route_params};
$new_request->{_params_are_decoded} = 1;
$new_request->{headers} = $request->headers;
if( my $session = Dancer::Session->engine
&& Dancer::Session->get_current_session ) {
my $name = $session->session_name;
lib/Dancer/Request.pm view on Meta::CPAN
sub params {
my ($self, $source) = @_;
my @caller = caller;
if (not $self->{_params_are_decoded}) {
$self->{params} = _decode($self->{params});
$self->{_body_params} = _decode($self->{_body_params});
$self->{_query_params} = _decode($self->{_query_params});
$self->{_route_params} = _decode($self->{_route_params});
$self->{_params_are_decoded} = 1;
}
return %{$self->{params}} if wantarray && @_ == 1;
return $self->{params} if @_ == 1;
lib/Dancer/Request.pm view on Meta::CPAN
An alias to request_uri()
=head2 request_uri()
Return the raw, undecoded request URI path.
=head2 user()
Return remote user if defined.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/Auth/OAuth/Provider/AzureAD.pm view on Meta::CPAN
Accept => "application/json"
);
if ( $resp->is_success ) {
my $user = $self->_stringify_json_booleans(
JSON::MaybeXS::decode_json( $resp->decoded_content )
);
$session_data->{azuread}{user_info} = $user;
} else {
# To-Do: logging error
}
lib/Dancer2/Plugin/Auth/OAuth/Provider/AzureAD.pm view on Meta::CPAN
After login, the following session key will have contents: C<{oauth}{azuread}>
The token will probably be in C<{id_token}>
When log in has occured, the provider attempts to decode the resulting token
for information about the user. All of the decoded information can be found in
the session key: C<{oauth}{azuread}{login_info}>
The login email address, for example, will probably be in a key called
C<{unique_name}>
view all matches for this distribution
view release on metacpan or search on metacpan
t/000-base.t view on Meta::CPAN
my $test = Plack::Test->create(TestApp->to_app);
my $is_client_ok = $test->request(GET '/client_status');
unless ($is_client_ok->decoded_content eq 'available') {
# couldn't call "elastic", assume no local ES cluster
plan 'skip_all', 'ElasticSearch client not instantiable: ' . $is_client_ok->decoded_content;
}
my $count_response = $test->request(GET '/count');
ok($count_response->is_success, '... and we can talk to the ES instance');
my $count = from_json($count_response->decoded_content);
ok(exists $count->{hits},
q{... and the response looks like an ES response});
my $ref1 = $test->request(GET '/client_refname')->decoded_content;
my $ref2 = $test->request(GET '/client_refname')->decoded_content;
is($ref1, $ref2,
qq{... and both calls to elastic() return the same object ($ref1)});
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/EncryptID.pm view on Meta::CPAN
=head2 dancer_encrypt
C<dancer_encrypt(ID [,PREFIX])> - Encrypt the given ID, returns the encoded hash value.
If "PREFIX" is given, it will be added to the ID before encoding.
It can be used when decoding to verify the decoded value is valid.
=cut
plugin_keywords 'dancer_encrypt';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Core/Request.pm view on Meta::CPAN
# Private 'read-only' attributes for request params. See the params()
# method for the public interface.
#
# _body_params, _query_params and _route_params have setter methods that
# decode byte string to characters before setting; If you know you have
# decoded (character) params, such as output from a deserializer, you can
# set these directly in the request object hash to avoid the decode op.
sub _params { $_[0]->{'_params'} ||= $_[0]->_build_params }
sub _has_params { defined $_[0]->{'_params'} }
lib/Dancer2/Core/Request.pm view on Meta::CPAN
# returns characters and skipping the decode op in the setter ensures
# that numerical data "stays" numerical; decoding an SV that is an IV
# converts that to a PVIV. Some serializers are picky (JSON)..
$self->{_body_params} = $data;
# Set body parameters (decoded HMV)
$self->{'body_parameters'} =
Hash::MultiValue->from_mixed( is_hashref($data) ? %$data : () );
return $data;
}
lib/Dancer2/Core/Request.pm view on Meta::CPAN
if ($type) {
my $attr = "${type}_parameters";
return $self->$attr;
}
# merge together the *decoded* parameters
$self->{'merged_parameters'} ||= do {
my $query = $self->query_parameters;
my $body = $self->body_parameters;
my $route = $self->route_parameters; # not in Plack::Request
Hash::MultiValue->new( map $_->flatten, $query, $body, $route );
lib/Dancer2/Core/Request.pm view on Meta::CPAN
$new_params->{$key} = $value;
$new_request->{_query_params}->{$key} = $value;
$new_request->{query_parameters}->add( $key => $value );
}
# Copy params (these are already decoded)
$new_request->{_params} = $new_params;
$new_request->{_body_params} = $self->{_body_params};
$new_request->{_route_params} = $self->{_route_params};
$new_request->{headers} = $self->headers;
# Copy remaining settings
$new_request->{is_behind_proxy} = $self->{is_behind_proxy};
$new_request->{vars} = $self->{vars};
# Clone any existing decoded & cached body params. (GH#1116 GH#1269)
$new_request->{'body_parameters'} = $self->body_parameters->clone;
# Delete merged HMV parameters, allowing them to be reconstructed on first use.
delete $new_request->{'merged_parameters'};
lib/Dancer2/Core/Request.pm view on Meta::CPAN
Returns the body of the request in data form, making it possible to distinguish
between C<body_parameters>, a representation of the request parameters
(L<Hash::MultiValue>) and other forms of content.
If a serializer is set, this is the deserialized request body. Otherwise this is
the decoded body parameters (if any), or the body content itself.
=head2 content
Returns the undecoded byte string POST body.
=head2 cookies
Returns a reference to a hash containing cookies, where the keys are the names of the
cookies and values are L<Dancer2::Core::Cookie> objects.
lib/Dancer2/Core/Request.pm view on Meta::CPAN
Alias to the C<method> accessor, for backward-compatibility with C<CGI> interface.
=head2 request_uri
Return the raw, undecoded request URI path.
=head2 route
Return the L<route|Dancer2::Core::Route> which this request matched.
view all matches for this distribution