Skip to content

Instantly share code, notes, and snippets.

@SebDeclercq
Created June 13, 2012 14:09
Show Gist options
  • Save SebDeclercq/2924300 to your computer and use it in GitHub Desktop.
Save SebDeclercq/2924300 to your computer and use it in GitHub Desktop.
#! /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