in reply to Re: Can't call method "foo" on unblessed reference
in thread Can't call method "foo" on unblessed reference

I believe your syntax for initializing your class is incorrect in sub new
Why? Its practically identical to what you wrote.
  • Comment on Re^2: Can't call method "foo" on unblessed reference