in reply to Hash problem

I don't know exactly what your problem is, but perhaps this code could solve it? :)

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @lines; while (<DATA>) { my %line; ++$line{$_} for split /\s+/; push @lines, { %line }; } print Dumper \@lines; __DATA__ one two three three one two one one three


it prints

$VAR1 = [ { 'three' => 1, 'one' => 1, 'two' => 1 }, { 'three' => 1, 'one' => 1, 'two' => 1 }, { 'three' => 1, 'one' => 2 } ];