view release on metacpan or search on metacpan
view all matches for this distribution
1314151617181920212223
Content-Type header; it is now
default
to UTF-8.
0.40 Thu Aug 18 17:53:06 CEST 2005
- fixed nusty bug
when
serializing to XML headers combined
with
body. Make
sure that headers as decoded and body is a valid UTF-8 string into XML.
0.39 Thu Aug 18 01:44:46 CEST 2005
- fixed bug
when
Content-Type is not specified; and
default
to text/plain
(and
do
not base64-encode body text)
view release on metacpan or search on metacpan
lib/Email/Outlook/Message.pm view on Meta::CPAN
view all matches for this distribution
405406407408409410411412413414415sub
_create_mime_plain_body {
my
$self
=
shift
;
my
$charset
=
$self
->_body_plain_character_set;
my
$body_str
=
$self
->{BODY_PLAIN};
if
(
$charset
ne
"UTF-8"
) {
# In this case, the body is a string of octets and needs to be decoded.
$body_str
= Encode::decode(
$charset
,
$body_str
);
}
return
Email::MIME->create(
attributes
=> {
content_type
=>
"text/plain"
,
view release on metacpan or search on metacpan
lib/Email/Simple/Header.pm view on Meta::CPAN
187188189190191192193194195196#pod
#pod =method header
#pod
#pod This method just calls C<header_raw>. It's the older name for C<header_raw>,
#pod but it can be a problem because L<Email::MIME>, a subclass of Email::Simple,
#pod makes C<header> return the header's decoded value.
#pod
#pod =cut
sub
_str_value {
return
ref
$_
[0] ?
$_
[0][0] :
$_
[0] }
lib/Email/Simple/Header.pm view on Meta::CPAN
view all matches for this distribution
553554555556557558559560561562=head2 header
This method just calls C<header_raw>. It's the older name for C<header_raw>,
but it can be a problem because L<Email::MIME>, a subclass of Email::Simple,
makes C<header> return the header's decoded value.
=head2 header_raw_set
$header->header_raw_set($field => @values);
view release on metacpan or search on metacpan
lib/Email/Stuffer/TestLinks.pm view on Meta::CPAN
view all matches for this distribution
71727374757677787980my
$response
=
shift
;
return
Future->fail(
"Response code was "
.
$response
->code)
if
(
$response
->code !~ /^2\d\d/);
if
(
$response
->content_type eq
'text/html'
) {
my
$dom
= Mojo::DOM->new(
$response
->decoded_content);
if
(
my
$title
=
$dom
->at(
'title'
)) {
return
Future->fail(
"Page title contains text '$1'"
)
if
$title
->text =~ /(error|not found)/i;
}
}
view release on metacpan or search on metacpan
Changes.pod view on Meta::CPAN
view all matches for this distribution
13141315131613171318131913201321132213231324
automaticly set status to 301.
- setting http headers and <META HTTP-EQUIV=..> now works also
in cgi mode.
- Session Handling now also works in CGI mode (needs
Apache::Session >= 1.04)
- ACTION attribute of Formtag is now URL en/decoded. Spotted by
Hartmut Palm.
=head1 1.2b9 (BETA) 10. Sept 1999
- Fixed a problem with loading Apache::Session 1.01, when
view release on metacpan or search on metacpan
lib/Emoji/NationalFlag.pm view on Meta::CPAN
view all matches for this distribution
60616263646566676869=head2 code2flag($iso_3166_1_alpha_2_code): Optional[NationalFlagEmoji]
This method returns national flag emoji if the supplied code (case insensitive) is valid, otherwise returns C<undef>
=head2 flag2code($decoded_national_flag_emoji): Optional[lc(CountryCodeAlpha-2)]
This method returns lower case of ISO 3166-1 alpha-2 country code if the supplied emoji is valid, otherwise returns C<undef>
=head1 AUTHOR
view release on metacpan or search on metacpan
lib/Encode/Argv.pm view on Meta::CPAN
view all matches for this distribution
4041424344454647484950515253545556Encode::Argv - Automatically Mess With
@ARGV
's Encoding
=head1 SYNOPSIS
use Encode::Argv ('cp932');
# Now @ARGV is decoded unicode characters, decoded from cp932
use Encode::Argv ('cp932' => 'euc-jp');
# Now @ARGV is encoded into euc-jp after being decoded from cp932
use Encode::Argv;
# Now @ARGV is decoded from whatever Term::Encoding thinks you are
# using on your terminal.
=head1 DESCRIPTION
I saw L<http://search.cpan.org/dist/Sjis|Sjis.pm> and L<http://www.aritia.org/hizumi/perl/perlwin.html|this>, and thought, "Well, I can't fix /all/ of their
view release on metacpan or search on metacpan
lib/Encode/Base32/Crockford.pm view on Meta::CPAN
view all matches for this distribution
165166167168169170171172173174175or
my
$decoded
= base32_decode_with_checksum(
"16JD"
);
my
$encoded
= base32_encode_with_checksum(1234);
=head1 METHODS
=head2 base32_encode
view release on metacpan or search on metacpan
lib/Encode/Base32/GMP.pm view on Meta::CPAN
view all matches for this distribution
171172173174175176177178179180181
base32hex: [0123456789ABCDEFGHIJKLMNOPQRSTUV]
gmp: [0123456789ABCDEFGHIJKLMNOPQRSTUV]
The encode_base32, decode_base32 and md5_base32 methods support an alphabet
parameter which can be set to the supported alphabets to indicate the value
to be encoded or decoded:
[
qw/crockford rfc4648 base32hex zbase32 gmp/
]
This module functions similarly to L<Encode::Base58::GMP>
with
Base32 being
ideal
for
case-insensitive encoding and Base58 being ideal
for
case-sensitive
view release on metacpan or search on metacpan
lib/Encode/Base58/BigInt.pm view on Meta::CPAN
4748495051525354555657585960616263646566sub
decode_base58 {
my
$str
=
shift
;
$str
=~
tr
/0OlI/DD11/;
$str
=~
$reg
or croak
"Invalid Base58"
;
my
$decoded
= Math::BigInt->new(0);
my
$multi
= Math::BigInt->new(1);
my
$base
=
@$chars
;
while
(
length
$str
> 0) {
my
$digit
=
chop
$str
;
$decoded
->badd(
$multi
->copy->bmul(
$map
->{
$digit
}));
$multi
->bmul(
$base
);
}
"$decoded"
;
}
1;
__END__
lib/Encode/Base58/BigInt.pm view on Meta::CPAN
view all matches for this distribution
7273747576777879808182=head1 SYNOPSIS
use Encode::Base58::BigInt;
my $bigint = '9235113611380768826';
my $encoded = encode_base58($bigint);
my $decoded = decode_base58($short); # decoded is bigint string
=head1 DESCRIPTION
Encode::Base58::BigInt is a base58 encoder/decoder implementation in Perl.
view release on metacpan or search on metacpan
lib/Encode/Base58/GMP.pm view on Meta::CPAN
view all matches for this distribution
147148149150151152153154155156GMP Alphabet: [0-9A-Za-v]
The encode_base58, decode_base58 and md5_base58 methods support an alphabet
parameter which can be set to the supported alphabets [
'bitcoin'
,
'flickr'
,
'gmp'
] to indicate the value to be encoded or decoded.
=head2 Requirements
This module requires GMP 4.2.0 and above. Prior versions are limited to Base36.
view release on metacpan or search on metacpan
lib/Encode/Base58.pm view on Meta::CPAN
view all matches for this distribution
3839404142434445464748495051525354555657}
sub
decode_base58 {
my
$str
=
shift
;
my
$decoded
= 0;
my
$multi
= 1;
my
$base
=
@alpha
;
while
(
length
$str
> 0) {
my
$digit
=
chop
$str
;
$decoded
+=
$multi
*
$alpha
{
$digit
};
$multi
*=
$base
;
}
return
$decoded
;
}
1;
__END__
view release on metacpan or search on metacpan
t/encodedecode.t view on Meta::CPAN
view all matches for this distribution
101112131415my
$BS
= new Encode::Bootstring();
my
$raw
=
'Búlgarska'
;
my
$enc
=
$BS
->encode(
$raw
);
my
$dec
=
$BS
->decode(
$enc
);
ok(
$enc
ne
$dec
,
'not encoded'
);
ok(
$dec
eq
$raw
,
'decoded same as original'
);
view release on metacpan or search on metacpan
view all matches for this distribution
50515253545556575859606162sub
decode ($$;$) {
my
(
$self
,
$octets
,
$check
) =
@_
;
my
$charset
= detect(
$octets
) ||
'Windows-1252'
;
my
$e
= find_encoding(
$charset
) or
die
"Unknown encoding: $charset"
;
my
$decoded
=
$e
->decode(
$octets
,
$check
|| 0);
$_
[1] =
$octets
if
$check
;
return
$decoded
;
}
1;
__END__
view release on metacpan or search on metacpan
t/Encode-Escape-ASCII.t view on Meta::CPAN
19202122232425262728293031323334353637383940414243444546$string
=
"\a\b\e\f\n\r\t\\\"\$\@"
;
$escaped
=
"\\a\\b\\e\\f\\n\\r\\t\\\\\\\"\\\$\\\@"
;
is
$string
,
(decode
'ascii-escape'
,
$escaped
),
'decoded character escape sequences'
;
is
$escaped
,
(encode
'ascii-escape'
,
$string
),
'encoded character escape sequences'
;
$string_oct
=
"\0\00\000\11\011\100"
;
$escaped_oct
=
"\\0\\00\\000\\11\\011\\100"
;
is
$string_oct
,
(decode
'ascii-escape'
,
$escaped_oct
),
'decoded octal escape sequences'
;
$string_hex
=
"\x09\x47\x57\x67\x77"
;
$escaped_hex
=
"\\x09\\x47\\x57\\x67\\x77"
;
is
$string_hex
,
(decode
'ascii-escape'
,
$escaped_hex
),
'decoded hex escape sequences'
;
$string_non_printing
=
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e"
.
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e"
.
"\x7f"
;
t/Encode-Escape-ASCII.t view on Meta::CPAN
view all matches for this distribution
495051525354555657
"\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\e\\x1c\\x1d\\x1e"
.
"\\x7f"
;
is
$string_non_printing
,
(decode
'ascii-escape'
,
$escaped_non_printing
),
'decoded non-printing characters'
;
is
$escaped_non_printing
,
(encode
'ascii-escape'
,
$string_non_printing
),
'encoded non-printing characters'
;
view release on metacpan or search on metacpan
lib/Encode/Float.pm view on Meta::CPAN
view all matches for this distribution
27282930313233343536373839for
(
my
$i
= 0 ;
$i
< 10 ;
$i
++)
{
my
$float
= (.5 -
rand
) * 10*
*int
(10 - 20 *
rand
);
$float
= 0
if
$i
== 0;
my
$encoded
=
$encoder
->encode(
$float
);
my
$decoded
=
$encoder
->decode(
$encoded
);
my
$error
=
$encoder
->getRelativeDifference(
$float
,
$decoded
);
push
@list
, [
$encoded
,
$float
,
$decoded
,
$error
];
}
@list
=
sort
{
$a
->[0] cmp
$b
->[0] }
@list
;
foreach
(
@list
)
{
join
(
','
,
@$_
) .
"\n"
;
view release on metacpan or search on metacpan
t/Encode-Korean-HSR.t view on Meta::CPAN
view all matches for this distribution
8384858687888990919293949596
"anj.a anja "
.
"anj.ja anjja "
.
"anjjja"
;
my
$encoded_ccs
= encode
'hsr'
,
$str_ccs
;
my
$decoded_ccs
= decode
'hsr'
,
$hsr_ccs
;
my
$decoded_ccs_smart_sep
= decode
'hsr'
,
$hsr_ccs_smart_sep
;
is
$encoded_ccs
,
$hsr_ccs
,
'encoded complex consonants group'
;
is
$decoded_ccs
,
$str_ccs
,
'decoded complex consonants group'
;
is
$decoded_ccs_smart_sep
,
$str_ccs
,
'decoded complex consonants group with smart sep'
;
is
$encoded_ccs
, (encode
'hsr'
,
$decoded_ccs
),
'encode ($enc, $decoded)'
;
is
$decoded_ccs
, (decode
'hsr'
,
$encoded_ccs
),
'decode ($enc, $encoded)'
;
view release on metacpan or search on metacpan
lib/Encode/Locale.pm view on Meta::CPAN
243244245246247248249250251252253254255256257258=item decode_argv( Encode::FB_CROAK )
This will decode the command line arguments to perl (the C<@ARGV> array) in-place.
The function will by default replace characters that can't be decoded by
"\x{FFFD}", the Unicode replacement character.
Any argument provided is passed as CHECK to underlying Encode::decode() call.
Pass the value C<Encode::FB_CROAK> to have the decoding croak if not all the
command line arguments can be decoded. See L<Encode/"Handling Malformed Data">
for details on other options for CHECK.
=item env( $uni_key )
=item env( $uni_key => $uni_value )
lib/Encode/Locale.pm view on Meta::CPAN
view all matches for this distribution
260261262263264265266267268269270Interface to get/set environment variables. Returns the current value as a
Unicode string. The
$uni_key
and
$uni_value
arguments are expected to be
Unicode strings as well. Passing C<
undef
> as
$uni_value
deletes the
environment variable named
$uni_key
.
The returned value will have the characters that can't be decoded replaced by
"\x{FFFD}"
, the Unicode replacement character.
There is
no
interface to request alternative CHECK behavior as
for
decode_argv(). If you need that you need to call encode/decode yourself.
For example:
view release on metacpan or search on metacpan
lib/Encode/Positive/Digits.pm view on Meta::CPAN
5455565758596061626364"number of decoding digits supplied($b) too few, must be at least 2"
;
my
@n
=
split
//,
$number
;
my
$n
=
@n
;
for
(1..
$n
)
# Convert each digit to be decoded with its decimal equivalent
{
my
$d
=
$n
[
$_
-1];
my
$i
=
index
(
$digits
,
$d
);
$i
< 0 and confess
"Invalid digit \"$d\" in number $number at position $_"
;
$n
[
$_
-1] =
$i
;
}
lib/Encode/Positive/Digits.pm view on Meta::CPAN
view all matches for this distribution
103104105106107108109110111112ok 5 == Encode::Positive::Digits::decode(
"101"
,
"01"
);
ok
"hello world"
eq Encode::Positive::Digits::encode(4830138323689,
" abcdefghlopqrw"
);
ok 4830138323689 == Encode::Positive::Digits::decode(
"hello world"
,
" abcdefghlopqrw"
);
The numbers to be encoded or decoded can be much greater than 2**64 via support
from L<Math::BigInt>, such numbers should be placed inside strings to avoid
inadvertent truncation.
my
$n
=
'1'
.(
'0'
x999).
'1'
;
view release on metacpan or search on metacpan
lib/Encode/Repair.pm view on Meta::CPAN
96979899100101102103104105106# prints: beta: β
repair_double(
"beta: \xc4\xaa\xc2\xb2\n"
, {
via
=>
'Latin-7'
});
# Advanced usage
# assumes you have a sample text both correctly decoded in a
# character string, and as a wrongly encoded buffer
binmode
STDOUT,
':encoding(UTF-8)'
;
lib/Encode/Repair.pm view on Meta::CPAN
view all matches for this distribution
143144145146147148149150151152153154155156157and was encoded as UTF-8 again. The other encoding defaults to ISO-8859-1 aka
Latin-1, and can be overridden
with
the C<via> option:
my
$repaired
= repair_double(
$buffer
, {
via
=>
'ISO-8859-2'
});
It expects an octet string as input, and returns a decoded character string.
=item learn_recoding
Given a sample of text twice, once correctly decoded and once mistreated,
attemps to find a sequence of encoding and decoding that turns the mistreated
text into the correct form.
my $coding_pattern = learn_recoding(
from => $mistreated_buffer,
view release on metacpan or search on metacpan
lib/Encode/Safename.pm view on Meta::CPAN
view all matches for this distribution
3637383940414243444546
$encoded
= encode(
'safename'
,
'Foo Bar Baz.txt'
);
# $encoded is now '{f}oo_{b}ar_{b}az.txt'
$decoded
= decode(
'safename'
,
$encoded
);
# $decoded is now 'Foo Bar Baz.txt'
=head1 DESCRIPTION
A filename is encoded as follows:
view release on metacpan or search on metacpan
lib/Decode/ARGV.pm view on Meta::CPAN
view all matches for this distribution
4849505152535455565758=head1 DESCRIPTION
This module provides simple in-place decoding of command-line arguments in the global array
L<@ARGV|perlvar/"@ARGV">. As with most input and output, command-line arguments are provided to the
script in bytes, and must be decoded to characters before performing string operations like
C<length> or regex matches.
The C<-CA> switch for Perl performs a similar function, but this has some deficiencies. It assumes
via the C<:utf8> internal layer that the arguments are valid UTF-8 bytes, ignoring invalid Unicode,
and even resulting in malformed strings if the bytes do not happen to be well-formed UTF-8. This
view release on metacpan or search on metacpan
t/01-decode.t view on Meta::CPAN
1112131415161718192021is
$wechsler
->decode(
'xq4_27deee6'
),
".**....
**.****
.******
..****.
",
'xq4_27deee6 decoded correctly'
;
is
$wechsler
->decode(
'xs31_0ca178b96z69d1d96'
),
"...**.**.
..*.*.*.*
.*..*...*
t/01-decode.t view on Meta::CPAN
2324252627282930313233.........
.*****...
*.....*..
*.*.*.*..
.**.**...
",
'xs31_0ca178b96z69d1d96 decoded correctly'
;
is
$wechsler
->decode(
'xp30_w33z8kqrqk8zzzx33'
),
"..**...
..**...
.......
t/01-decode.t view on Meta::CPAN
4950515253545556575859.......
.......
...**..
...**..
.......
",
'xp30_w33z8kqrqk8zzzx33 decoded correctly'
;
is
$wechsler
->decode(
'xp2_31a08zy0123cko'
),
"**........
*.*.......
..........
t/01-decode.t view on Meta::CPAN
view all matches for this distribution
62636465666768697071....*.*...
.....**...
.......**.
.......*.*
........**
",
'xp2_31a08zy0123cko decoded correctly'
;
#is $wechsler->decode( 'xp30_ccx8k2s3yagzy3103yaheha4xcczyk1' ),
#"
#", 'xp30_ccx8k2s3yagzy3103yaheha4xcczyk1 decoded correctly';
view release on metacpan or search on metacpan
lib/Encode/ZapCP1252.pm view on Meta::CPAN
view all matches for this distribution
289290291292293294295296297298299300
fix_cp1252;
# Modify $_ in-place.
my
$zapped
= zap_cp1252;
# Copy $_ and return zapped
my
$fixed
= zap_cp1252;
# Copy $_ and return fixed
In Perl 5.8.8 and higher, the conversion will work even
when
the string is
decoded to Perl
's internal form (usually via C<decode '
ISO-8859-1',
$text
>) or
the string is encoded (and thus simply processed by Perl as a series of
bytes). The conversion will even work on a string that
has
not been decoded
C<Encode::_utf8_on()>. This is to enable the highest possible likelihood of
removing those CP1252 gremlins
no
matter what kind of processing
has
already
been executed on the string.
view release on metacpan or search on metacpan
505506507508509510511512513514Unless you want Perl's older
"lax"
mode, prefer
C<
$string
= decode(
"UTF-8"
,
$octets
[, CHECK])>.
Equivalent to C<
$string
= decode(
"utf8"
,
$octets
[, CHECK])>.
The sequence of octets represented by
$octets
is decoded
from (loose, not strict) utf8 into a sequence of logical characters.
Because not all sequences of octets are valid not strict utf8,
it is quite possible
for
this function to fail.
For CHECK, see L</
"Handling Malformed Data"
>.
707708709710711712713714715716717For encodings that are implemented by the C<Encode::XS> module, C<CHECK> C<==>
C<Encode::FB_PERLQQ> puts C<encode> and C<decode> into C<perlqq> fallback mode.
When you decode, C<\xI<HH>> is inserted
for
a malformed character, where
I<HH> is the
hex
representation of the octet that could not be decoded to
utf8. When you encode, C<\x{I<HHHH>}> will be inserted, where I<HHHH> is
the Unicode code point (in any number of
hex
digits) of the character that
cannot be found in the character repertoire of the encoding.
The HTML/XML character reference modes are about the same. In place of
view all matches for this distribution
752753754755756757758759760761762
$ascii
= encode(
"ascii"
,
$utf8
,
sub
{
sprintf
"<U+%04X>"
,
shift
});
Acts like C<FB_PERLQQ> but U+I<XXXX> is used instead of C<\x{I<XXXX>}>.
Fallback
for
C<decode> must
return
decoded string (sequence of characters)
and takes a list of ordinal
values
as its arguments. So
for
a fallback
for
bytes that are not valid UTF-8, you could
write
$str
= decode
'UTF-8'
,
$octets
,
sub
{
view release on metacpan or search on metacpan
lib/Encoding/BER.pm view on Meta::CPAN
3536373839404142434445Unlike many other BER encoder/decoders, this module uses tree structured data
as the interface to/from the encoder/decoder.
data to be decoded. Given arbitrary BER encoded data, the decoder produces
a tree shaped perl data structure from it.
The encoder takes a perl data structure and produces a BER encoding from it.
=head1 METHODS
lib/Encoding/BER.pm view on Meta::CPAN
177178179180181182183184185186187188189190191192193
# example: warn for warnings
warn
=>
sub
{
warn
"how odd! $_[1]\n"
}
=item decoded_callback
coderef called for every element decoded. will be called with 2 parameters,
the Encoding::BER object, and the decoded data. [see DECODED DATA]
# example: bless decoded results into a useful class
decoded_callback => sub{ bless $_[1], MyBER::Result }
=item debug
boolean. if true, large amounts of useless gibberish will be sent to stderr regarding
the encoding or decoding process.
lib/Encoding/BER.pm view on Meta::CPAN
view all matches for this distribution
1031103210331034103510361037103810391040
$result
->{type} =
$typdat
;
$result
->{tagnum} =
$tagnum
;
$result
->{identval} =
$typval
;
if
(
my
$c
=
$me
->{decoded_callback} ){
$result
=
$c
->(
$me
,
$result
) ||
$result
;
# make sure the brain hasn't fallen out
}
return
(
$result
,
$tlen
);
}
view release on metacpan or search on metacpan
view all matches for this distribution
756757758759760761762763764765766%%
@doc
Yet another JSON (RFC 4627) library
for
Erlang. mochijson2 works
%%
with
binaries as strings, arrays as lists (without an {array, _})
%% wrapper and it only knows how to decode UTF-8 (and ASCII).
%%
%% JSON terms are decoded as follows (javascript -> erlang):
%% <ul>
%% <li>{
"key"
:
"value"
} ->
%% {struct, [{
<
;
<
;
"key"
>>,
<
;
<
;
"value"
>>}]}</li>
%% <li>[
"array"
, 123, 12.34, true, false, null] ->
%% [
<
;
<
;
"array"
>>, 123, 12.34, true, false, null]
view release on metacpan or search on metacpan
lib/Etcd3/Role/Actions.pm view on Meta::CPAN
132133134135136137138139140141142
return
$self
;
}
=head2 get_value
returns single decoded value or the first.
=cut
sub
get_value {
my
(
$self
) =
@_
;
lib/Etcd3/Role/Actions.pm view on Meta::CPAN
view all matches for this distribution
158159160161162163164165166167168
'value'
=>
'bar'
,
'create_revision'
=>
'3'
,
'key'
=>
'foo0'
}
where key and value have been decoded
for
your pleasure.
=cut
sub all {
my ($self) = @_;
view release on metacpan or search on metacpan
lib/Ethereum/RPC/Contract.pm view on Meta::CPAN
5960616263646566676869has
max_priority_fee_per_gas
=> (
is
=>
'rw'
);
has
gas
=> (
is
=>
'rw'
);
has
contract_decoded
=> (
is
=>
'rw'
,
default
=>
sub
{ {} },
);
=head2 BUILD
lib/Ethereum/RPC/Contract.pm view on Meta::CPAN
93949596979899100101102103104105106107108109110111112=cut
sub BUILD {
my ($self) = @_;
my @decoded_json = @{decode_json($self->contract_abi // "[]")};
for my $json_input (@decoded_json) {
if ($json_input->{type} =~ /^function|event|constructor$/) {
push(@{$self->contract_decoded->{$json_input->{name} // $json_input->{type}}}, $json_input->{inputs});
}
}
unless ($self->contract_decoded->{constructor}) {
push(@{$self->contract_decoded->{constructor}}, []);
}
return;
}
lib/Ethereum/RPC/Contract.pm view on Meta::CPAN
154155156157158159160161162163=cut
sub get_function_id {
my ($self, $function_name, $params_size) = @_;
my @inputs = @{$self->contract_decoded->{$function_name}};
my $selected_data = first { (not $_ and not $params_size) or ($params_size and scalar @{$_} == $params_size) } @inputs;
$function_name .= sprintf("(%s)", join(",", map { $_->{type} } grep { $_->{type} } @$selected_data));
lib/Ethereum/RPC/Contract.pm view on Meta::CPAN
view all matches for this distribution
232233234235236237238239240241242=cut
sub encode {
my ($self, $function_name, $params) = @_;
my $inputs = $self->contract_decoded->{$function_name}->[0];
# no inputs
return "" unless $inputs;
my $offset = $self->get_function_offset($inputs);
view release on metacpan or search on metacpan
lib/Eve/Json.pm view on Meta::CPAN
1819202122232425262728
my
$json
= Eve::Json->new();
my
$json_string
=
$json
->encode(
reference
=>
$reference
);
my
$decoded_reference
=
$json
->decode(
string
=>
$json_string
);
=head1 DESCRIPTION
The B<Eve::Json> class adapts the functionality of the JSON::XS
module to provide JSON encoding and decoding features service.
lib/Eve/Json.pm view on Meta::CPAN
view all matches for this distribution
74757677787980818283
return
$result
;
}
=head2 B<decode()>
Decodes a JSON string and returns a reference to its decoded contents.
=head3 Arguments
=over 4