Use the <FILE_HANDLE> construct.

While Ben will do this in one line, here is
how I would handle it.

If you NEED to open the file (rather than STDIN):
\nuse strict;\nopen (IN,"file.dat") or die "Can't open file - $!";\nmy %hash;\nwhile (<IN>){\n  chomp;\n  my ($key,$data) = split(' ',$_,2);\n  $hash{$key} = $data;\n}\nclose (IN);\n