use Tk; sub print_args { $ix = 0; foreach $arg (@_) { print "ARG $ix = $arg \n"; $ix++; } print "------------------\n"; } $mw = MainWindow -> new (); $mw -> title ("Test bind with parms"); $fill = $mw -> Label (-text => "TEST BIND - try both button and down arrow") -> pack (); $quit_but = $mw -> Button (-text => "QUIT", -background => "#ffffcc", -borderwidth => 5, -relief => ridge, -command => sub{exit}) -> pack (-side => bottom, -fill => "x"); $test_but = $mw -> Button (-text => "Invoke via button", -background => "#ddffff", -borderwidth => 5, -relief => ridge, -command => [ \&print_args, 3, 2, 11 ] ) -> pack (-side => bottom, -fill => "x"); $mw -> bind ('' => [ \&print_args, 3, 2, 11 ]); MainLoop; #### ARG 0 = 3 ARG 1 = 2 ARG 2 = 11 ------------------ #### ARG 0 = MainWindow=HASH(0x2c5c1cc) ARG 1 = 3 ARG 2 = 2 ARG 3 = 11