$ perle '1 for sort { say +(\*a)->*{PACKAGE}; say +(\*a)->*{SCALAR}->$*; say $a } 1 .. 3' main 1 1 main 2 2