$x overloads stringification, stringifying as "27". The new method presumably does something like:
sub new { my ($class, $value) = @_; bless { value => $value } => "$class"; }
Thus you end up with a reference blessed into package "27".
Generally speaking, constructors are designed to be called as class methods not object methods.
In reply to Re: Math::BigInt new
by tobyink
in thread Math::BigInt new
by QM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |