in reply to Making a button execute a command: Tk

At that very moment when being defined, or later, when called? Have you tried an anonymous sub?
-command => sub { $number=$number==0||$equals!=0?$input:$number.$input + },
Update: See the docs @ Tk::Button and follow the "Perl/Tk callback" link.