- or download this
#!/usr/bin/perl -w
...
'slash i' => sub { $s =~ /a/i; $s =~ /b/i; },
'brackets' => sub { $s =~ /[Aa]/; $s =~ /[Bb]/; },
});
- or download this
Benchmark: timing 1000000 iterations of brackets, slash i...
brackets: 24 wallclock secs (24.20 usr + 0.00 sys = 24.20 CPU)
...
slash i: 14 wallclock secs (13.47 usr + 0.00 sys = 13.47 CPU)
@ 74239.05/s (n=1000000)