JSON RESPONSE: Below is my json response which i am to parse from url.
[
{
"StationID": 17682,
"TVEStationID": 0,
"CallLetters": "DIYHD",
"StationName": "DIYHD",
"Affiliation": "Do-It-Yourself Network HD",
},
{
"StationID": 17683,
"TVEStationID": 0,
"CallLetters": "WGNA",
"StationName": "WGNA",
"Affiliation": "WGN America HD",
}
]
Perl code :
my $response = $ua->get('https://myurl here......');
if ($response->is_success) {
print $response->decoded_content;
}
I have to parse above json and store it into a variable for all five values, I am new in perl not able to find out the solution for this, Please help me to parse this.
Here, I am getting success response but inside the response how i have to parse and get the value... from array that i am not able to do.
Thankyou
get()function you're calling on$response? What output are you getting? And what exactly are you struggling with?my $response = $ua->get('https://myurl here......');you're getting the JSON response and you need to store in what? Parse it in which format? Shall we know how your output should look like from the response you're getting?Dumperfor$data. You will get response from the URL which is been mentioned in$ua->get(..)in very nice format. From there you can take forward how to insert it in table. You can open separate thread if parsing from$databecomes difficult.