{"action":"created","comment":{"url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/comments/32198027","id":32198027,"diff_hunk":"@@ -0,0 +1,66 @@\n+#!/usr/bin/perl\n+use v5.10;\n+use strict;\n+use warnings;\n+use Data::Dumper;\n+\n+my %total_bytes;\n+\n+my $filename = 'chapter05/mssw/coconet.dat';\n+\n+# my $filename = 'chapter05/mssw/coconet-sample.dat';  # smaller sample\n+\n+open( my $fh, '<:encoding(UTF-8)', $filename )\n+  or die \"could not open file '$filename' $!\";\n+\n+while ( my $row = <$fh> ) {\n+\n+    # check if the line starts with a '#' and skip it\n+    if ( $row =~ /^\\s*#/ ) {\n+        next;\n+    }\n+    my ( $source, $destination, $bytes ) = split /\\s+/, $row;\n+    $total_bytes{$source}{$destination} += $bytes;\n+}\n+\n+# Lets create a complex hash! \\o/\n+#  %report = (\n+#   $source => {\n+#     destinations = {\n+#       $destination => $bytes,\n+#       ...\n+#     },\n+#     total = $total_bytes,\n+#   },\n+#   ...\n+# );\n+my %report;\n+foreach my $source ( sort keys %total_bytes ) {\n+    for my $destination ( sort keys %{ $total_bytes{$source} } ) {\n+        $report{$source}->{destinations}{$destination} +=\n+          $total_bytes{$source}{$destination};\n+        $report{$source}->{total} += $total_bytes{$source}{$destination};","path":"chapter05/mssw/exercise2.pl","position":42,"original_position":42,"commit_id":"aa14934da8244e8372b0e239b0272c2eeebee78e","original_commit_id":"aa14934da8244e8372b0e239b0272c2eeebee78e","user":{"login":"Spinodal","id":2004473,"avatar_url":"https://avatars.githubusercontent.com/u/2004473?v=3","gravatar_id":"","url":"https://api.github.com/users/Spinodal","html_url":"https://github.com/Spinodal","followers_url":"https://api.github.com/users/Spinodal/followers","following_url":"https://api.github.com/users/Spinodal/following{/other_user}","gists_url":"https://api.github.com/users/Spinodal/gists{/gist_id}","starred_url":"https://api.github.com/users/Spinodal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spinodal/subscriptions","organizations_url":"https://api.github.com/users/Spinodal/orgs","repos_url":"https://api.github.com/users/Spinodal/repos","events_url":"https://api.github.com/users/Spinodal/events{/privacy}","received_events_url":"https://api.github.com/users/Spinodal/received_events","type":"User","site_admin":false},"body":"I thought you need at least one arrow to get the party started? seeing as `%report` isn't a reference","created_at":"2015-06-11T08:09:49Z","updated_at":"2015-06-11T08:09:49Z","html_url":"https://github.com/ardavey/Intermediate-Perl/pull/27#discussion_r32198027","pull_request_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/comments/32198027"},"html":{"href":"https://github.com/ardavey/Intermediate-Perl/pull/27#discussion_r32198027"},"pull_request":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/27","id":37309289,"html_url":"https://github.com/ardavey/Intermediate-Perl/pull/27","diff_url":"https://github.com/ardavey/Intermediate-Perl/pull/27.diff","patch_url":"https://github.com/ardavey/Intermediate-Perl/pull/27.patch","issue_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/27","number":27,"state":"open","locked":false,"title":"Mssw chapter05","user":{"login":"Spinodal","id":2004473,"avatar_url":"https://avatars.githubusercontent.com/u/2004473?v=3","gravatar_id":"","url":"https://api.github.com/users/Spinodal","html_url":"https://github.com/Spinodal","followers_url":"https://api.github.com/users/Spinodal/followers","following_url":"https://api.github.com/users/Spinodal/following{/other_user}","gists_url":"https://api.github.com/users/Spinodal/gists{/gist_id}","starred_url":"https://api.github.com/users/Spinodal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spinodal/subscriptions","organizations_url":"https://api.github.com/users/Spinodal/orgs","repos_url":"https://api.github.com/users/Spinodal/repos","events_url":"https://api.github.com/users/Spinodal/events{/privacy}","received_events_url":"https://api.github.com/users/Spinodal/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-09T22:57:24Z","updated_at":"2015-06-11T08:09:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3de7bec63c6027a968141dd0723bb9f333b1dbba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/27/commits","review_comments_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/27/comments","review_comment_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/27/comments","statuses_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/statuses/aa14934da8244e8372b0e239b0272c2eeebee78e","head":{"label":"ardavey:mssw_chapter05","ref":"mssw_chapter05","sha":"aa14934da8244e8372b0e239b0272c2eeebee78e","user":{"login":"ardavey","id":2790047,"avatar_url":"https://avatars.githubusercontent.com/u/2790047?v=3","gravatar_id":"","url":"https://api.github.com/users/ardavey","html_url":"https://github.com/ardavey","followers_url":"https://api.github.com/users/ardavey/followers","following_url":"https://api.github.com/users/ardavey/following{/other_user}","gists_url":"https://api.github.com/users/ardavey/gists{/gist_id}","starred_url":"https://api.github.com/users/ardavey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardavey/subscriptions","organizations_url":"https://api.github.com/users/ardavey/orgs","repos_url":"https://api.github.com/users/ardavey/repos","events_url":"https://api.github.com/users/ardavey/events{/privacy}","received_events_url":"https://api.github.com/users/ardavey/received_events","type":"User","site_admin":false},"repo":{"id":26066281,"name":"Intermediate-Perl","full_name":"ardavey/Intermediate-Perl","owner":{"login":"ardavey","id":2790047,"avatar_url":"https://avatars.githubusercontent.com/u/2790047?v=3","gravatar_id":"","url":"https://api.github.com/users/ardavey","html_url":"https://github.com/ardavey","followers_url":"https://api.github.com/users/ardavey/followers","following_url":"https://api.github.com/users/ardavey/following{/other_user}","gists_url":"https://api.github.com/users/ardavey/gists{/gist_id}","starred_url":"https://api.github.com/users/ardavey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardavey/subscriptions","organizations_url":"https://api.github.com/users/ardavey/orgs","repos_url":"https://api.github.com/users/ardavey/repos","events_url":"https://api.github.com/users/ardavey/events{/privacy}","received_events_url":"https://api.github.com/users/ardavey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ardavey/Intermediate-Perl","description":"Exercise solutions from the O'Reilly book of the same name.","fork":false,"url":"https://api.github.com/repos/ardavey/Intermediate-Perl","forks_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/forks","keys_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/teams","hooks_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/hooks","issue_events_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/events{/number}","events_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/events","assignees_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/assignees{/user}","branches_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/branches{/branch}","tags_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/tags","blobs_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/refs{/sha}","trees_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/statuses/{sha}","languages_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/languages","stargazers_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/stargazers","contributors_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/contributors","subscribers_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/subscribers","subscription_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/subscription","commits_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/commits{/sha}","git_commits_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/commits{/sha}","comments_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/comments{/number}","issue_comment_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/comments{/number}","contents_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/contents/{+path}","compare_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/merges","archive_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/downloads","issues_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues{/number}","pulls_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls{/number}","milestones_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/milestones{/number}","notifications_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/labels{/name}","releases_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/releases{/id}","created_at":"2014-11-01T23:27:01Z","updated_at":"2015-05-22T09:48:20Z","pushed_at":"2015-06-11T07:58:48Z","git_url":"git://github.com/ardavey/Intermediate-Perl.git","ssh_url":"git@github.com:ardavey/Intermediate-Perl.git","clone_url":"https://github.com/ardavey/Intermediate-Perl.git","svn_url":"https://github.com/ardavey/Intermediate-Perl","homepage":null,"size":1102,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"ardavey:master","ref":"master","sha":"7ea0a4473d0906a58bd8775a01c16df1070e61a7","user":{"login":"ardavey","id":2790047,"avatar_url":"https://avatars.githubusercontent.com/u/2790047?v=3","gravatar_id":"","url":"https://api.github.com/users/ardavey","html_url":"https://github.com/ardavey","followers_url":"https://api.github.com/users/ardavey/followers","following_url":"https://api.github.com/users/ardavey/following{/other_user}","gists_url":"https://api.github.com/users/ardavey/gists{/gist_id}","starred_url":"https://api.github.com/users/ardavey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardavey/subscriptions","organizations_url":"https://api.github.com/users/ardavey/orgs","repos_url":"https://api.github.com/users/ardavey/repos","events_url":"https://api.github.com/users/ardavey/events{/privacy}","received_events_url":"https://api.github.com/users/ardavey/received_events","type":"User","site_admin":false},"repo":{"id":26066281,"name":"Intermediate-Perl","full_name":"ardavey/Intermediate-Perl","owner":{"login":"ardavey","id":2790047,"avatar_url":"https://avatars.githubusercontent.com/u/2790047?v=3","gravatar_id":"","url":"https://api.github.com/users/ardavey","html_url":"https://github.com/ardavey","followers_url":"https://api.github.com/users/ardavey/followers","following_url":"https://api.github.com/users/ardavey/following{/other_user}","gists_url":"https://api.github.com/users/ardavey/gists{/gist_id}","starred_url":"https://api.github.com/users/ardavey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardavey/subscriptions","organizations_url":"https://api.github.com/users/ardavey/orgs","repos_url":"https://api.github.com/users/ardavey/repos","events_url":"https://api.github.com/users/ardavey/events{/privacy}","received_events_url":"https://api.github.com/users/ardavey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ardavey/Intermediate-Perl","description":"Exercise solutions from the O'Reilly book of the same name.","fork":false,"url":"https://api.github.com/repos/ardavey/Intermediate-Perl","forks_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/forks","keys_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/teams","hooks_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/hooks","issue_events_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/events{/number}","events_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/events","assignees_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/assignees{/user}","branches_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/branches{/branch}","tags_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/tags","blobs_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/refs{/sha}","trees_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/statuses/{sha}","languages_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/languages","stargazers_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/stargazers","contributors_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/contributors","subscribers_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/subscribers","subscription_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/subscription","commits_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/commits{/sha}","git_commits_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/commits{/sha}","comments_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/comments{/number}","issue_comment_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/comments{/number}","contents_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/contents/{+path}","compare_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/merges","archive_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/downloads","issues_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues{/number}","pulls_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls{/number}","milestones_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/milestones{/number}","notifications_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/labels{/name}","releases_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/releases{/id}","created_at":"2014-11-01T23:27:01Z","updated_at":"2015-05-22T09:48:20Z","pushed_at":"2015-06-11T07:58:48Z","git_url":"git://github.com/ardavey/Intermediate-Perl.git","ssh_url":"git@github.com:ardavey/Intermediate-Perl.git","clone_url":"https://github.com/ardavey/Intermediate-Perl.git","svn_url":"https://github.com/ardavey/Intermediate-Perl","homepage":null,"size":1102,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/27"},"html":{"href":"https://github.com/ardavey/Intermediate-Perl/pull/27"},"issue":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/27"},"comments":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/statuses/aa14934da8244e8372b0e239b0272c2eeebee78e"}}}}