#!/usr/bin/perl use strict; use warnings; use Data::Dumper::Simple; my %hash; while(){ chomp; my @array = split /\s{2,}/; $hash{$array[0]} = { $array[1] => $array[2] }; } print(Dumper(%hash));