sub new_counter { my ($start) = @_; my $count = $start; return { add => sub { my ($value) = @_; $count += $value; }, get => sub { return $count; }, }; } #### sub new_counter { my ($count) = @_; ... }