{ "_id" : 0, "name" : "Betty Boop", "subjects" : [ { "type" : "optional", "subject" : "Voice"}, { "type" : "required", "subject" : "Math" }, { "type" : "required", "subject" : "English" } ] } { "_id" : 1, "name" : "Donald Duck", "subjects" : [ { "type" : "optional", "subject" : "Accounting" }, { "type" : "required", "subject" : "Math" }, { "type" : "required", "subject" : "English" } ] } #### #!/usr/bin/env perl use JSON; use Data::Dumper; use Perl6::Slurp; my $file = 'test.json'; my $json = slurp $file; $text = decode_json($json); print Dumper($text);