sub make_accessor { my $foo; return sub { my $in = shift; if defined($in) { $foo = $in; } return $foo; } }