in reply to Is the problem JComboBox, Perl/Tk or (probably) me!?

You are not assigning a value to $p1 in the second button, and you're not passing an argument to &test in the first button. Forgot about the [ .. ] construct in Tk, see above for actual problem. this is why i always use sub { ... } callbacks in Tk, though.

I think you want

$mw->Button( -text => 'func', -command => sub { test($jcb->getSelectedValue($jcb->getSelectedInde +x())) } , )->pack; $mw->Button( -text => 'embed', -command => sub { my $p1 = $jcb->getSelectedIndex(); printf("e: \$p +1 = >>$p1<<\n"); } )->pack;