9 Einträge, 1 Seite |
if (scalar (grep {/$i/} @lst)) { ...}
1
2
3
4
5
6
7
$delm = ';;';
@array = ('val1','val2','IchTanzeAusDerReihe','val4','val5');
$such = 'IchTanzeAusDerReihe';
unless (index( $delm.join($delm,@array).$delm, $delm.$such.$delm ) == -1 ) {
print "Gefunden ... !";
}
1
2
3
Benchmark: timing 1000000 iterations of grep, index...
grep: 11 wallclock secs (10.22 usr + 0.00 sys = 10.22 CPU) @ 97895.25/s (n=1000000)
index: 2 wallclock secs ( 2.28 usr + 0.00 sys = 2.28 CPU) @ 438020.15/s (n=1000000)
1
2
3
4
5
6
7
$delm = ';;';
@array = ('val1','val2','IchTanzeAusDerReihe','val4','val5');
$such = 'IchTanzeAusDerReihe';
unless (index( $delm.join($delm,@array).$delm, $delm.$such.$delm ) == -1 ) {
print "Gefunden ... !";
}
1
2
3
Benchmark: timing 1000000 iterations of grep, index...
grep: 11 wallclock secs (10.22 usr + 0.00 sys = 10.22 CPU) @ 97895.25/s (n=1000000)
index: 2 wallclock secs ( 2.28 usr + 0.00 sys = 2.28 CPU) @ 438020.15/s (n=1000000)
1
2
3
4
5
6
7
$delm = ';;';
@array = ('val1','val2','IchTanze','AusDerReihe','val4','val5');
$such = 'IchTanze;;AusDerReihe';
unless (index( $delm.join($delm,@array).$delm, $delm.$such.$delm ) == -1 ) {
print "Gefunden ... !";
}
9 Einträge, 1 Seite |