or download this
BUGS
bless is not supported on shared references. In the current
...
error message. But the $hashref->{key} is not shared, causing
the error "locking can only be used on shared values" to occur
when you attempt to lock $hasref->{key}.