use strict;
use warnings;

package DoStuff;

our $current_self = undef;

sub new {
  my ($class) = @_;
  my $self = $current_self = {};
  bless $self, $class;
  open CONFIG, "<config";
  my @config = <CONFIG>;
  close CONFIG;
  eval join('', @config);
  $current_self = undef;
  return $self;
}

sub do_stuff (&) {
  my ($func) = @_;
  $current_self->{'do_stuff'} = $func;
}

sub run_func {
  my ($self) = @_;
  &{$self->{'do_stuff'}};
}

package main;

my $a = DoStuff->new();
$a->run_func();
