Created
June 13, 2012 14:09
-
-
Save SebDeclercq/2924300 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl -w | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use Data::Dump; | |
my %total_bytes; | |
while (<>) { | |
my ($source,$destination,$bytes) = split; | |
$total_bytes{$source}{$destination} += $bytes; | |
} | |
say dd(%total_bytes); | |
say 'Hello'; | |
### DATA FILE | |
#professor.hut gilligan.crew.hut 1250 | |
#professor.hut lovey.howell.hut 910 | |
#thurston.howell.hut lovey.howell.hut 1250 | |
#professor.hut lovey.howell.hut 450 | |
#ginger.girl.hut professor.hut 1218 | |
#ginger.girl.hut maryann.girl.hut 199 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment