package Foo; sub new{ bless { a => undef } , shift ;} memoize('bar'); sub bar{shift->{'a'} ;}