in reply to Re^2: overloading core function and non-existing operator
in thread overloading core function and non-existing operator
and main scope itself is also a package just like any other package. Will that help to make ++ overloadable in main?
sure, if you see it that way... you just have to bless your variable, just like you did with your Number-package.
i think that's not what you want, just wanted to make clear that it's not a problem of the package name but that you must have a blessed object.use overload ...; my $n = bless {number => 23}, "main"; print $n >> 2;
|
|---|