#!/usr/local/bin/perl use strict; use warnings; use Tk; my $mw = tkinit(); my $txt_var; my $spin = $mw->Spinbox(-from => 0, -to => 100, -textvariable => \$txt_var)->pack(-side => 'left'); $spin->bind('', sub {print shift . "\n" . $txt_var}); MainLoop;