Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use v6;
- use WWW;
- my $url = 'https://api.github.com/search/repositories?q=language:perl+6&sort=stars';
- my $response_dict = jget $url;
- put "Total repositories: $response_dict<total_count>";
- # Explore information about the repositories
- # This will appropriately tell me there are 30 repos returned
- my @repo_dicts = $response_dict<items>;
- put "Repositories returned: " ~ @repo_dicts[0].elems;
- # This is wrong and tells me only 1 repo returned
- # Why?
- @repo_dicts = $response_dict<items>[0];
- put "Repositories returned: " ~ @repo_dicts.elems;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement