First off, I know this is a fairly common issue but I have looked around and can't quite seem to pinpoint why its happening to me!
I have some data I am reading from a JSON file, basically all it is are a set of string that represent IDs.
I import it like so:
my $idFile='IDS.json';
my $idJSON;
{
local $/;
open my $fh, '<', $idFile or die $!;
$idJSON = <$fh>;
close $fh;
}
my $id_array = decode_json $idJSON;
This is what $id_array looks like now:
$VAR1 = [
'3233',
'2758',
'2797'
];
I then save them with a MISC tag in the form of a hash map, but this is where my "Can't use string ("3233") as a HASH ref while "strict refs" in use " error is being thrown:
my @decodedIDS = map { $_ ->{MISC}} @{$id_array};
Anyone have suggestions as to what is causing this error? Any help is greatly appreciated, as always.
@decodedIDSto contain? - ThisSuitIsBlackNot@decodedIDS = map { MISC => $_ } @{$id_array}? - mobmy %decodedIDS = map { $_ => 1 } @$id_array;would create a hash keyed by id. - ikegami