We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f4c7549 + bc8732e commit caa07bdCopy full SHA for caa07bd
lib/JSON/PP.pm
@@ -112,7 +112,7 @@ sub encode_json ($) { # encode
112
}
113
114
115
-sub decode_json { # decode
+sub decode_json ($) { # decode
116
($JSON ||= __PACKAGE__->new->utf8)->decode(@_);
117
118
t/gh_54_context_sensitive_read_file.t
@@ -0,0 +1,21 @@
1
+use strict;
2
+use warnings;
3
+use Test::More;
4
+
5
+BEGIN { plan tests => 1 };
6
7
+BEGIN { $ENV{PERL_JSON_BACKEND} = 0; }
8
9
+use JSON::PP;
10
11
+my $ds = eval { JSON::PP::decode_json read_file() };
12
+ok !$@, "No error" or note $@;
13
14
+sub read_file {
15
+ my $json = <<"JSON";
16
+{
17
+"camel": "Amelia"
18
+}
19
+JSON
20
+ wantarray ? split(/\R/, $json) : $json;
21
0 commit comments