in reply to Tk::Browseentry -browsecmd Option with Subroutine Parameter

Here's the problem:
\&selection("option1")

This is not a reference to subroutine called with a parameter. In fact, there's no such a thing as a code reference plus parameters. You have two options:

  1. Use a subroutine:
    -browsecmd => sub { selection('option1') }
  2. Tk allows you to specify a callback as an array reference (the first member is the code ref, the rest the parameters):
    -browsercmd => [ \&selection, 'option1' ]
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Tk::Browseentry -browsecmd Option with Subroutine Parameter
by erpse (Initiate) on Mar 19, 2015 at 15:00 UTC

    That absolutely solves my problem! Thank you!
    Another example of: "Once you do it right, it works" ;)