Rakudo Perl Hacking Rakudo Perl #81

Setting

Many methods that we would normally think of as being on List, Str, Int, Hash, etc. actually belong on Any.

For example:

my $a = prompt "Enter a value";
say $a.abs;

Q: Where should .abs be defined in order for this to work?

A: Any (not Int or Num)

Copyright © 2009
http://www.pmichaud.com/2009/pres/