#!/usr/bin/perl use diagnostics; use strict; use warnings; use Tk; my $mw = new MainWindow; my $Count = 0; $mw->Button(-text => "Button\nerzeugen", -command => \&button_erzeugen, ) ->pack(-side => 'right', -expand => 1, -fill => 'both', ); MainLoop(); sub button_erzeugen { ++$Count; $mw->Button(-text => "erzeugter\nButton\n" . $Count, ) ->pack(-side => 'left', -expand => 1, -fill => 'both', ); }