perl code to decode json array to find the last value of a variable : I have a Json array of objects that I am trying to decode in perl. The json array looks like this :
[
  { "name":"a123",
     "enroll":"12a123",
      "cs":{
               "year1":{
                          "status"{
                                     "oldvalue":"pending",
                                      "new value": "complete"
                                  }
                       }
            }
     },
     { "name":"b123",
     "enroll":"12b123",
      "ecm":{
               "year1":{
                          "flag"{
                                     "oldvalue":"null",
                                      "new value": "ok"
                                  }
                       }
            }
     },
 { "name":"c123",
     "enroll":"12c123",
      "cs":{
               "year1":{
                          "status"{
                                     "oldvalue":"complete",
                                      "new value": "run new"
                                  }
                       }
            }
     }
]

I want to find the value of the {"status"}->{"new value"} from the last occurrence in the Json file.The output here should be "run new". FYI : not all fields are present in every object. Any help on how to parse this array will be highly appreciated. 

Thanks in advance. 



