in reply to $self->{foo} in sub new {}

traditionally I would do:

sub new { my $classs = shift; my $self = { foo => $_[0] }; # initiate the fooneff bless $self, $class; }
the problem you ran into is several fold.
  1. your $self is the class being passed in
  2. you then convert it into a hash_ref
  3. you then bless an empty hash and retreat into an old dog

Your work around is somewhat ingenous, since you re-use the $self in a creative way. But unless you really have a good reason to want to have a 'reference' passed in to your new() as an instance method, you really should avoid it.