Cross posted on perlguru
ram 47 nasdfi 47 klsdjf 258 dshafa 639 is being read-in as a single string which you then use as a key in the hash. Hashes are key/value pairs so they need an even number of elements.
You need to split that single string into its 8 elements then use those elements to assign your hash.
This can be done in 1 line, but I'll break it up for clarity.
my $string = <STDIN>;
my @elements = split $string;
die "Odd number of elements" if @elements % 2; # sanity check
my %input = @elements;