in reply to Accessing values of a Hash object

There is a lot of room for improvements (use of lexical variables instead of package variables, elimination of constant 2nd arg for bless, elimination of indirect method invocation), but the problem is that $arg has a newline.

Change
$arg=<stdin>;
to
chomp($arg=<stdin>);

Ref: chomp, IO Operators

Update: Oh and change
print $arg;
to
return $arg;