Du musst -variable vorbelegen:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl
use strict;
use warnings 'all';
use Tk;
use Tk::BrowseEntry;
my $mw = tkinit();
sub createbe
{
my($num, $values) = @_; # pick parameters
# create BrowseEntry
my $be = $mw -> BrowseEntry(-background => 'white')->pack();
$be->{MY_VAR} = $values->[$num];
$be -> configure(-variable => \$be->{MY_VAR});
# insert values
foreach (@$values)
{ $be -> insert('end', $_) }
# return BrowseEntry
return $be;
} # createbe
createbe(0, ['A'..'Z']);
createbe(1, ['a'..'z']);
createbe(2, [ 1 .. 9 ]);
MainLoop;
MfG\n\n
<!--EDIT|PerlProfi|1172303959-->