view release on metacpan or search on metacpan
lib/File/Name/Check.pm view on Meta::CPAN
sub _reencode {
my $self = shift;
my ( $bytes, $encoding) = @_;
no warnings 'utf8';
if ( $bytes ne encode( $encoding, decode( $encoding, $bytes ) ) ) {
# say '*** decoded: ', decode( $encoding, $bytes );
# say ' quoted: ', decode( $encoding, $bytes, Encode::FB_PERLQQ );
return 0;
}
else { return 1; }
}
view all matches for this distribution
view release on metacpan or search on metacpan
filenames as Perl strings consisting of unicode characters,
while CORE::readme() and other file tests still working on
octet strings. This is enabled with -u (--unicode).
It is possible to specify the encoding of filenames, with:
--unicode encoding. Filenames are decoded from octet
strings to unicode strings before applying the user code,
and then the resulting string is encoded for CORE::rename.
upgrade filenames to unicode (encoded as utf8) by default.
COPYRIGHT AND LICENCE
view all matches for this distribution
view release on metacpan or search on metacpan
script/rsybak view on Meta::CPAN
# my $key = $1;
# my $val = $2;
#
# if ($val =~ /\A["!\\[\{~]/) {
# $_raw_val = $val if $cb;
# my ($err, $parse_res, $decoded_val) = $self->_parse_raw_value($val);
# $self->_err("Invalid value: " . $err) if $err;
# $val = $decoded_val;
# } else {
# $_raw_val = $val if $cb;
# $val =~ s/\s*[#;].*//;
# }
#
script/rsybak view on Meta::CPAN
#codeset range. Neither of these flags conflict with each other, although
#some combinations make less sense than others.
#
#Care has been taken to make all flags symmetrical with respect to
#C<encode> and C<decode>, that is, texts encoded with any combination of
#these flag values will be correctly decoded when the same flags are used
#- in general, if you use different flag settings while encoding vs. when
#decoding you likely have a bug somewhere.
#
#Below comes a verbose discussion of these flags. Note that a "codeset" is
#simply an abstract set of character-codepoint pairs, while an encoding
script/rsybak view on Meta::CPAN
#=item C<utf8> flag disabled
#
#When C<utf8> is disabled (the default), then C<encode>/C<decode> generate
#and expect Unicode strings, that is, characters with high ordinal Unicode
#values (> 255) will be encoded as such characters, and likewise such
#characters are decoded as-is, no changes to them will be done, except
#"(re-)interpreting" them as Unicode codepoints or Unicode characters,
#respectively (to Perl, these are the same thing in strings unless you do
#funny/weird/dumb stuff).
#
#This is useful when you want to do the encoding yourself (e.g. when you
script/rsybak view on Meta::CPAN
# $rargs->{$arg} //= {};
# $val_set = 1; $val = $_[2];
# $rargs->{$arg}{$_[1]} = $val;
# } else {
# {
# my ($success, $e, $decoded);
# ($success, $e, $decoded) = _parse_json($_[1]);
# if ($success) {
# $val_set = 1; $val = $decoded;
# $rargs->{$arg} = $val;
# last;
# }
# ($success, $e, $decoded) = _parse_yaml($_[1]);
# if ($success) {
# $val_set = 1; $val = $decoded;
# $rargs->{$arg} = $val;
# last;
# }
# die "Invalid YAML/JSON in arg '$fqarg'";
# }
script/rsybak view on Meta::CPAN
# } elsif (defined $extra->{is_neg}) {
# $go_spec->{$ospec} = sub { $handler->($_[0], 1) };
# } elsif ($extra->{is_base64}) {
# $go_spec->{$ospec} = sub {
# require MIME::Base64;
# my $decoded = MIME::Base64::decode($_[1]);
# $handler->($_[0], $decoded);
# };
# } else {
# $go_spec->{$ospec} = $handler;
# }
#
script/rsybak view on Meta::CPAN
# warn "Clash of option: $jopt, not added";
# } else {
# my $jospec = "$jopt=s";
# my $parsed = {type=>"s", opts=>[$jopt]};
# $go_spec->{$jospec} = sub {
# my ($success, $e, $decoded);
# ($success, $e, $decoded) = _parse_json($_[1]);
# if ($success) {
# $rargs->{$arg} = $decoded;
# } else {
# die "Invalid JSON in option --$jopt: $_[1]: $e";
# }
# };
# $specmeta->{$jospec} = {arg=>$arg, fqarg=>$fqarg, is_json=>1, parsed=>$parsed, %$extra};
script/rsybak view on Meta::CPAN
# warn "Clash of option: $yopt, not added";
# } else {
# my $yospec = "$yopt=s";
# my $parsed = {type=>"s", opts=>[$yopt]};
# $go_spec->{$yospec} = sub {
# my ($success, $e, $decoded);
# ($success, $e, $decoded) = _parse_yaml($_[1]);
# if ($success) {
# $rargs->{$arg} = $decoded;
# } else {
# die "Invalid YAML in option --$yopt: $_[1]: $e";
# }
# };
# $specmeta->{$yospec} = {arg=>$arg, fqarg=>$fqarg, is_yaml=>1, parsed=>$parsed, %$extra};
script/rsybak view on Meta::CPAN
# !$is_array_of_simple && !$is_hash_of_simple) {
# my $i = 0;
# for (@$val) {
# TRY_PARSING_AS_JSON_YAML:
# {
# my ($success, $e, $decoded);
# if ($per_arg_json) {
# ($success, $e, $decoded) = _parse_json($_);
# if ($success) {
# $_ = $decoded;
# last TRY_PARSING_AS_JSON_YAML;
# } else {
# warn "Failed trying to parse argv #$i as JSON: $e";
# }
# }
# if ($per_arg_yaml) {
# ($success, $e, $decoded) = _parse_yaml($_);
# if ($success) {
# $_ = $decoded;
# last TRY_PARSING_AS_JSON_YAML;
# } else {
# warn "Failed trying to parse argv #$i as YAML: $e";
# }
# }
script/rsybak view on Meta::CPAN
# }
# }
# if (!$arg_spec->{greedy} && !$is_simple) {
# TRY_PARSING_AS_JSON_YAML:
# {
# my ($success, $e, $decoded);
# if ($per_arg_json) {
# ($success, $e, $decoded) = _parse_json($val);
# if ($success) {
# $val = $decoded;
# last TRY_PARSING_AS_JSON_YAML;
# } else {
# warn "Failed trying to parse argv #$arg_spec->{pos} as JSON: $e";
# }
# }
# if ($per_arg_yaml) {
# ($success, $e, $decoded) = _parse_yaml($val);
# if ($success) {
# $val = $decoded;
# last TRY_PARSING_AS_JSON_YAML;
# } else {
# warn "Failed trying to parse argv #$arg_spec->{pos} as YAML: $e";
# }
# }
view all matches for this distribution
view release on metacpan or search on metacpan
FileList/FileList.pm view on Meta::CPAN
file lists.
=head2 Utility functions
The count() function returns the total number of files in the internal
file list (either decoded or encoded).
The fatalError() function returns true if a fatal error has occured
during file decoding. It should be called in the decode loop to
make sure no error has occured.
view all matches for this distribution
view release on metacpan or search on metacpan
examples/procmail/scanvirus.pl view on Meta::CPAN
my $files = shift;
my $tmp_dir = shift;
my $file = shift;
my ($filename) = ($file =~ /\/?([^\/]+)$/);
my $decoded = join("/", $tmp_dir, "$filename\.eml");
open(ENCFILE, "<$file") or return("Can't open $file: $!\n");
open(DECFILE, join("", ">$decoded")) or return("Can't open $decoded: $!\n");
binmode(DECFILE);
while(<ENCFILE>) { print DECFILE rfc822_base64($_); }
close(DECFILE);
close(ENCFILE);
$files->{$decoded} = "";
return("");
}
#---mhtml_exploit---------------------------------------------------------
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/SharedVar.pm view on Meta::CPAN
require JSON;
JSON->import;
};
#my $json_text = encode_json($data);
#my $decoded_data = decode_json($json_text);
=head1 METHODS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/Sip.pm view on Meta::CPAN
=head2 is_utf8
Optional, flag to tell if the file is utf8-encoded, default is true.
If true, the line returned by C<read_line> will be decoded.
=head2 index
Index that contains positions of all lines of the file, usage:
view all matches for this distribution
view release on metacpan or search on metacpan
# when I extract the parts between the boundary string and feed this
# to metamail one by one, it works well.
env METAMAIL_TMPDIR=. metamail -d -w jpeg.mm
This message contains 'image/jpeg`-format data.
which is being decoded and written to the file named "./Unknown.jpeg".
If you do not want this data, you probably should delete that file.
Wrote file ./Unknown.jpeg
view all matches for this distribution
view release on metacpan or search on metacpan
# when I extract the parts between the boundary string and feed this
# to metamail one by one, it works well.
env METAMAIL_TMPDIR=. metamail -d -w jpeg.mm
This message contains 'image/jpeg`-format data.
which is being decoded and written to the file named "./Unknown.jpeg".
If you do not want this data, you probably should delete that file.
Wrote file ./Unknown.jpeg
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/ValueFile/Simple/Reader.pm view on Meta::CPAN
The list of supported features. This can be a single format, a arrayref of formats, or C<'all'>.
Formats can be given by ISE or as L<Data::Identifier>.
=item C<utf8>
The UTF-8 flag for the decoded data. If set to true, values are decoded as UTF-8.
If set to (non-C<undef>) false values are decoded as 8-bit strings (binary).
If set to C<auto> the UTF-8 flag is automatically detected using the format and features.
This is the default.
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FileSystem/LL/FAT.pm view on Meta::CPAN
Returns an empty list unless signature is correct.
=head2 interpret_bootsector($bootsector)
Takes a string containing 512Byte bootsector; returns a hash reference
with decoded fields. The keys include
jump oem sector_size sectors_in_cluster FAT_table_off num_FAT_tables
root_dir_entries total_sectors1 media_type sectors_per_FAT16
sectors_per_track heads hidden_sectors total_sectors2
machine_code FS_type boot_signature volume_label physical_drive
lib/FileSystem/LL/FAT.pm view on Meta::CPAN
extended_bpb head___dirty_flags
=head2 check_bootsector($fields)
Takes a hash reference with decoded fields of a bootsector; returns
TRUE if minimal sanity checks hold; die()s otherwise.
=head2 interpret_directory($dir, $is_fat32, [$keep_del, [$keep_dots, [$keep_labels]]])
($res, $files) = interpret_directory($dir, $is_FAT32);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FilmAffinity/UserRating.pm view on Meta::CPAN
my ($next, $page) = (1, 1);
while ( $next ){
my $url = $self->p_buildUrl( $page );
my $response = $self->ua->get($url);
if ($response->is_success){
my $content = $response->decoded_content();
$self->parseString($content);
$next = $self->p_isNextPage($content);
$page++;
} else {
$next = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
CryptFile/lib/Filter/Crypto/CryptFile.pm view on Meta::CPAN
given.
=item Can't decode odd-numbered (%d-byte) length hexadecimal text
The hexadecimal encoding of the encrypted source code, consisting of a pair of
hexadecimal digits for each byte of data, could not be decoded because an odd
number of hexadecimal digits were found.
=item Can't decode non-hexadecimal digit (byte %02x at position %d) in
hexadecimal text
The hexadecimal encoding of the encrypted source code, consisting of a pair of
hexadecimal digits for each byte of data, could not be decoded because a byte
other than a hexadecimal digit was found.
=item Can't derive %d-byte key: %s
libcrypto's PKCS#5 v2.0 compatible key derivation algorithm failed to derive a
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Filter/Dockerfile.pm view on Meta::CPAN
if ( -f $uri ) {
local $/ = undef;
open my $fh, $uri || die "$uri: $!";
push @content, join("", <$fh>);
} else {
push @content, $self->{ua}->get($uri)->decoded_content();
}
}
chomp(@content);
@content = merge($merge, \@content, $include, $exclude);
$_ = "print <<'EOM';\n".join("\n", @content)."\nEOM\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Filter/Encoding.pm view on Meta::CPAN
=head1 DESCRIPTION
This module allows your code to be written in any ASCII-based encoding.
Just pass the name of the encoding as an argument to C<use
Filter::Encoding>. The source code will be decoded and treated as though it had been written in UTF-8 with C<use utf8> in effect. That's all this
module does.
It is intended as a simpler, saner replacement for L<encoding.pm|encoding>,
one that does not change the up- and downgrading of strings or touch your
file handles.
view all matches for this distribution
view release on metacpan or search on metacpan
examples/closure/UUdecode.pm view on Meta::CPAN
}
# uudecode the line
$_ = unpack("u", $_) ;
# return the uudecoded data
return $status ;
}
})
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/BTCIndo.pm view on Meta::CPAN
log_trace("JSON API request: %s", $url);
my $res = $self->{_http}->get($url);
die "Can't retrieve $url: $res->{status} - $res->{reason}"
unless $res->{success};
my $decoded;
eval { $decoded = $self->{_json}->decode($res->{content}) };
die "Can't decode response from $url: $@" if $@;
log_trace("JSON API response: %s", $decoded);
$decoded;
}
sub tapi {
my ($self, $method, %args) = @_;
lib/Finance/BTCIndo.pm view on Meta::CPAN
my $url = "$url_prefix/tapi/";
my $res = $self->{_http}->post($url, $options);
die "Can't retrieve $url: $res->{status} - $res->{reason}"
unless $res->{success};
my $decoded;
eval { $decoded = $self->{_json}->decode($res->{content}) };
die "Can't decode response from $url: $@" if $@;
log_trace("TAPI response: %s", $decoded);
die "API response not a hash: $decoded" unless ref $decoded eq 'HASH';
die "API response is not success: $decoded->{error}" unless $decoded->{success};
$decoded;
}
sub _check_pair {
my $pair = shift;
$pair =~ /\A(\w{3,5})_(\w{3,5})\z/
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Bank/Kraken.pm view on Meta::CPAN
Sets or gets the API key.
=item $api->secret($secret)
Sets the API secret to C<$secret> or returns the API secret base64 decoded.
=item $result = $api->call(Public, $method)
=item $result = $api->call(Private, $method)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Bank/LloydsTSB/Account.pm view on Meta::CPAN
if (! $self->_on_account_overview_page) {
# This is the one we want
# my @links = $self->ua->find_all_links;
# my $correct = $links[0]->text;
# GRR! gets decoded into \xa0 by HTML::TokeParser
# (which uses HTML::Entities::decode_entities)
unless ($self->ua->follow_link(text_regex =>
qr/Account[ \xa0]overview/))
{
# my $dumpfile = '/tmp/dump.html';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HAL/Resource.pm view on Meta::CPAN
my $ua = WWW::Mechanize->new();
my $res = $ua->get('https://api.example.com/');
my $r = HAL::Resource->new(
ua => $ua,
%{ decode_json( $res->decoded_content ) },
);
=head1 ABOUT
This module is just a very thin wrapper for HAL resources. If you find this
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Bank/Paytrail.pm view on Meta::CPAN
(Nice-to-have) Populated when you call submit. The entire unprocessed response content.
=cut
has 'server_response' => ( is => 'rw' ); # the response as a perl data structure, decoded from json
=head2 result_code
(Nice-to-have) Populated when you call submit. The HTTP status code of the reply.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/BitFlip.pm view on Meta::CPAN
my $url = "$url_prefix$method_args";
my $res = $self->{_http}->get($url);
die "Can't retrieve $url: $res->{status} - $res->{reason}"
unless $res->{success};
my $decoded;
eval { $decoded = $self->{_json}->decode($res->{content}) };
die "Can't decode response from $url: $@" if $@;
log_trace("API GET response: %s", $decoded);
die "API response not an array: $decoded" unless ref $decoded eq 'ARRAY';
die "API response is not success: $decoded->[0] - $decoded->[1]" if defined $decoded->[0];
$decoded;
}
sub post_request {
my ($self, $method, %args) = @_;
lib/Finance/BitFlip.pm view on Meta::CPAN
my $url = "$url_prefix$method";
my $res = $self->{_http}->post($url, $options);
die "Can't retrieve $url: $res->{status} - $res->{reason}"
unless $res->{success};
my $decoded;
eval { $decoded = $self->{_json}->decode($res->{content}) };
die "Can't decode response from $url: $@" if $@;
log_trace("API POST response: %s", $decoded);
die "API response not an array: $decoded" unless ref $decoded eq 'ARRAY';
die "API response is not success: $decoded->[0] - $decoded->[1]" if defined $decoded->[0];
$decoded;
}
1;
# ABSTRACT: Trade with bitflip.li using Perl
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Bitcoin/Yacuna.pm view on Meta::CPAN
elsif('POST' eq $httpMethod){
my $req = new HTTP::Request('POST', $self->{'uri'} . $self->{'basePath'} . $self->{'apiVersion'}.'/'.$restPath);
$req->content_type('application/x-www-form-urlencoded');
$req->content($body);
my $res = $self->{'httpClient'}->request($req);
return $res->decoded_content;
}
};
return $self->{'httpClient'}->response->decoded_content if $self->{'httpClient'}->response;
}
sub prepareAuth(){
my ($path, $body, $httpMethod, $apiSecret, $debug) = @_;
my $tokenSalt = ''.time*1000;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Card/Discover.pm view on Meta::CPAN
return unless $res->is_success;
# The response content is a url-encoded string.
my %data = do {
my $u = URI->new;
$u->query($res->decoded_content);
$u->query_form
};
return if not %data or 'error' eq $data{action};
return \%data;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/CoinbasePro/Lite.pm view on Meta::CPAN
log_trace("JSON API request: %s", $url);
my $res = $self->{_http}->get($url);
die "Can't retrieve $url: $res->{status} - $res->{reason}"
unless $res->{success};
my $decoded;
eval { $decoded = $self->{_json}->decode($res->{content}) };
die "Can't decode response from $url: $@" if $@;
log_trace("JSON API response: %s", $decoded);
$decoded;
}
sub _request {
my ($self, $is_private, $method, $request_path, $params) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
CompanyNames/TextSupport.pm view on Meta::CPAN
declassification declassified declassify declassifying
declayed declaying
declination declinations decline declined decliner decliners declines declining
declinist declinists
declutched declutching
decodable decode decoded decoder decoders decodes decoding
decoked decoking
decollation decollators
decollete decolletes
decolonization decolonize decolonized decolonizing
decoloration decolored decoloring
CompanyNames/TextSupport.pm view on Meta::CPAN
precursor precursors precursory
precusor precusors
predate predation predator predators
predecease predeceases
predecessor predecessors
predecoded predecoder
predefinable predefine predefined predefines predefining
predeterminable predeterminately predetermine predetermined predetermining
predicate predicated predicates
predict predictabilities predictability predictable predictably predictated predicted predicting prediction predictions predictive predictively predicts
predictor predictors
CompanyNames/TextSupport.pm view on Meta::CPAN
decliner
decliners
declines
declining
decode
decoded
decoder
decoders
decodes
decoding
decodings
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Crypto/Exchange/Kraken.pm view on Meta::CPAN
my $response = $self->ua->request($req);
if ($response->is_success) {
my $data;
try {
$data = decode_json($response->decoded_content);
}
catch {
die "Unable to decode JSON from Kraken!", $/;
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Dogecoin/API.pm view on Meta::CPAN
while (my ($key, $value) = each %params) {
$uri->query_param( $key => $value );
}
my $response = $self->ua->get( $uri );
my $result = $self->json->decode( $response->decoded_content );
Carp::croak( "Bad API call from $method() call" ) if $result eq 'Bad Query';
Carp::croak( "Invalid API key '" . $self->api_key . "'" )
if $result eq 'Invalid API Key';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/Indodax.pm view on Meta::CPAN
log_trace("JSON API request: %s", $url);
my $res = $self->{_http}->get($url);
die "Can't retrieve $url: $res->{status} - $res->{reason}"
unless $res->{success};
my $decoded;
eval { $decoded = $self->{_json}->decode($res->{content}) };
die "Can't decode response from $url: $@" if $@;
log_trace("JSON API response: %s", $decoded);
$decoded;
}
sub tapi {
my ($self, $method, %args) = @_;
lib/Finance/Indodax.pm view on Meta::CPAN
my $url = "$url_prefix/tapi/";
my $res = $self->{_http}->post($url, $options);
die "Can't retrieve $url: $res->{status} - $res->{reason}"
unless $res->{success};
my $decoded;
eval { $decoded = $self->{_json}->decode($res->{content}) };
die "Can't decode response from $url: $@" if $@;
log_trace("TAPI response: %s", $decoded);
die "API response not a hash: $decoded" unless ref $decoded eq 'HASH';
die "API response is not success: $decoded->{error}" unless $decoded->{success};
$decoded;
}
sub _check_pair {
my $pair = shift;
$pair =~ /\A(\w{3,5})_(\w{3,5})\z/
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Finance/PremiumBonds.pm view on Meta::CPAN
if (!$resp->is_success) {
warn "Request failed - " . $resp->status_line;
return;
}
my $resp_data = JSON::from_json($resp->decoded_content);
if ($resp_data->{holder_number} eq 'is_invalid') {
carp "Holder number not recognised by NS+I";
return;
}
view all matches for this distribution