in reply to Extracting a hash reference from a string

You don't want require. You want do. Quoting perlfunc:
do 'stat.pl'; is just like scalar eval `cat stat.pl`; except that it's more efficient and concise, keeps track of the current filename for error messages, searches the @INC libraries, and updates %INC if the file is found.
Assuming some_code.pl is
die +{ foo => 1 };
you can easily test that it does what you want:
do 'some_code.pl'; print ref $@ if $@; =output HASH
You should not fiddle with pointers. What if a future revision somewhere in a different place, likely made by a different maintainer who is not aware of your trickery, undoes the guarantee for the hash's refcount? There's a reason that module is in the Devel:: namespace. I'd be wary of any production code that uses it.

Makeshifts last the longest.