Help for this page

Select Code to Download


  1. or download this
    foreach $key (keys %hash) {
        $key = quotemeta $key;
        $text =~ s/$key/$hash{$key}/eg;
    }
    
  2. or download this
    use Benchmark;
    
    ...
    Benchmark: timing 100000 iterations of Alternation, Simple loop...
    Alternation:  5 wallclock secs ( 4.12 usr +  0.00 sys =  4.12 CPU) @ 2
    +4271.84/s (n=100000)
    Simple loop: 10 wallclock secs ( 9.72 usr +  0.00 sys =  9.72 CPU) @ 1
    +0288.07/s (n=100000)