in reply to $self->{foo} in sub new {}
traditionally I would do:
the problem you ran into is several fold.sub new { my $classs = shift; my $self = { foo => $_[0] }; # initiate the fooneff bless $self, $class; }
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.
|
|---|