Advertisement
Guest User

Untitled

a guest
Dec 30th, 2017
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.54 KB | None | 0 0
  1. use v6;
  2. use WWW;
  3.  
  4. my $url = 'https://api.github.com/search/repositories?q=language:perl+6&sort=stars';
  5. my $response_dict = jget $url;
  6.  
  7. put "Total repositories: $response_dict<total_count>";
  8.  
  9. # Explore information about the repositories
  10. # This will appropriately tell me there are 30 repos returned
  11. my @repo_dicts = $response_dict<items>;
  12. put "Repositories returned: " ~ @repo_dicts[0].elems;
  13.  
  14. # This is wrong and tells me only 1 repo returned
  15. # Why?
  16. @repo_dicts = $response_dict<items>[0];
  17. put "Repositories returned: " ~ @repo_dicts.elems;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement