Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: parse json

by 1nickt (Canon)
on Sep 15, 2025 at 12:34 UTC ( [id://11166232]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11166232]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2026-01-13 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.