{ package foo; sub new { bless {}, shift } sub foo { ++$_[0]{foo} } } $foo = foo->new; $cr = sub { $foo->foo(@_) }; print $cr->(), "\n" for 1 .. 5;