http://www.perlmonks.org?node_id=332895


in reply to Re: inheritance turns back and bites
in thread inheritance turns back and bites

sub new { bless \pop, shift } it's like doing sub new { bless \42, "MyNumber" } and you can't bless a constant into an object. so do my $arg = pop; bless \$arg, shift
I do not think this is wrong, since \pop is like \pop @_ and whatever I pop it is pushed and a pushed constant is a scalar.
Boris