Warum nicht ein kleines Modul, kannste dann mit "use XXX" aufrufen und alles klappt.
Mit sprintf wird es noch ein bisschen eleganter, TIMTOWTDI ;-)
# abspeichern als XXX.pm
package XXX;
use Exporter;
our @ISA = ("Exporter");
our @EXPORT = qw (strDate sub_2);
sub strDate { # Ausgabe JJJJ.TT.MM mit führender Null
my @jetzt = localtime;
return sprintf "%4d.%02d.%02d", $jetzt[5]+1900, ++$jetzt[4], $jetzt[3];
}
sub sub_2{
# Hier die nächste Funktion
}
# etc.
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"