#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my %data; while (my $line = ) { chomp $line; [parse the input] [assign to your hash] } print Dumper \%data; # check to see if your code set up the HoA correctly __DATA__ 01;22411384 01;18337723 02;38381289 02;38938222 10;13293383