How can I call methods on Perl scalars?

overloading, perl, scalar

Solution

Are you referring to autobox? See also Should I use autobox in Perl?.

Problem

I saw some code that called methods on scalars (numbers), something like: ``` print 42->is_odd ``` What do you have to overload so that you can achieve this sort of "functionality" in your code?

Original source

Related problems