Thread durch eigene error_log läuft script
(18 answers)
Opened by bieber at 2007-08-02 10:43
Geschwindigkeit ist ein weiterer Grund ;)
Code (perl): (dl
)
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 use strict; use warnings; use Benchmark; my @datei = (1,'',2,';',3,'#'); sub long { foreach(@datei){ next if /^$/; my $check="false"; chomp; my @work = split /\s+/; $work[0]=~ s/^\s+//g; next if substr ($work[0],0,1) eq '#'; next if substr ($work[0],0,1) eq ';'; next if substr ($work[0],0,1) eq ''; } } sub short { foreach (@datei) { my $check = "false"; next if /^\s*(?:[#;]|$)/; chomp; my @work = split /\s+/; } } Benchmark::cmpthese(-1, { long => \&long, short => \&short, }) What is a good module? That's hard to say.
What is good code? That's also hard to say. One man's Thing of Beauty is another's man's Evil Hack. |