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, })