daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Dec 30th, 2017 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top