in reply to Re^2: parse json
in thread parse json

Is the home team always listed first, and the away team second?

The second element of an array is at index position 1.

So maybe

my $home = $match->{competitions}[0]{competitors}[0]{'team'}{n +ame}; my $away = $match->{competitions}[0]{competitors}[1]{'team'}{n +ame}; my $home_score = $match->{competitions}[0]{competitors}[0]{score}; my $away_score = $match->{competitions}[0]{competitors}[1]{score};


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^4: parse json
by frank1 (Monk) on Sep 15, 2025 at 13:00 UTC

    thank you so much, its working