Okay, I have this method:
sub config {
my $filename = 'perl_config.txt';
my $json_text = do {
open(my $json_fh, "<:encoding(UTF-8)", $filename)
or die("Can't open the file!");
local $/;
<$json_fh>
};
my $json = JSON->new;
my $data = $json->decode($json_text);
};
Terminal (interpreter rather ;) ) says:
'"' expected, at character offset 115 (before "}") at ./proj_perl.pl line 25
Line 25 indicates on my $data = $json->decode($json_text);
EDIT: I've edited my question and cut unnecessary code. I still don't know what's wrong. My JSON file is:
{
"local_host": "localhost",
"local_port": "6000",
"save_dir": "received_files",
"my_data": "my_data.txt",
}
"my_data.txt")