in reply to parse out json message

You are looping over sports when you want to be looping over teams.


🦛

Replies are listed 'Best First'.
Re^2: parse out json message
by frank1 (Monk) on Sep 15, 2025 at 18:56 UTC

    i tried this and dont get anything out

    for my $match (@{$parse_json->{teams}}) {

      teams is not at the top level. You have at least leagues on your way into the data structure.

      Consider an online viewer like, say https://jsoncrack.com/editor or maybe https://jsonviewer.stack.hu/ to visualize the data structure.

      You have to learn to read JSON and how to translate that structure into Perl.

        i still get zero response

        for my $match (@{$parse_json->{leagues}}) { my $teamname = $match->{teams}[0]{team}{shortDisplayName};