Leser: 1
8 Einträge, 1 Seite |
pktm+2008-01-16 23:23:36--Warum sollte man saubere Schnittstellen verwenden
1 2 3 4 5 6 7 8 9 10 11
package MyApp::Config; use warnings; use strict; use Readonly; use vars qw( %Fonts ); Readonly::Hash %Fonts => ( default => 'Arial 12 normal', bold => 'Arial 12 bold', );
1 2 3 4 5 6 7
sub CreateLabel { my( $parent, $text, ... ) = @_; $parent->Label( -font => $MyApp::Config::Fonts{default}, -text => $text, ... );
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/perl use strict; use warnings; start(); sub start{ my $date = today(); say( $date ); } sub today{ my ($day,$month,$year) = (localtime time)[3..5]; return sprintf "%02d.%02d.%04d", $day, $month+1, $year+1900; } sub say{ print @_, "\n"; }
8 Einträge, 1 Seite |