package MyApp::Widgets; use warnings; use strict; use constant BACKGROUND_COLOR => '#bfdcc0'; # als konstante our $StandardFont = 'Arial 12 normal'; # als "globale" variable use vars qw($BoldFont); # ebenfalls "global" $BoldFont = 'Arial 12 normal'; my $fixedFont = "Courier 12 normal"; # oder normale my-variable sub Button { my ($parent, $text, $callback, %options) = @_; my %options2 = (); if (defined $callback and ref $callback) { $options2{-command} = $callback; } # if else { $options2{-state} = 'disabled'; } if (ref $text) { $options2{-textvariable} = $text; } else { $options2{-text} = $text; } return $parent->Button( -background => BACKGROUND_COLOR, -font => $StandardFont, -paddx => 5, -pady => 4, %options2, %options, ); } # Button # ----------------------------------------------------- sub Frame { ... } #...