Help for this page

Select Code to Download


  1. or download this
    sub index_split_join {
        return $_[0] unless index $_[0], 'STOCK' >= 0;  # do a fast check 
    +to see if line needs to be looked at
    ...
        $tokens[15] =~ s/STOCK/BOXXE/;    # do replacement in col 16
        return join('|',@tokens);         # glue back together for final r
    +esult
    }
    
  2. or download this
                     Rate    splitjoin idxsplitjoin simple_regex
    splitjoin     50000/s           --         -15%         -60%
    idxsplitjoin  58824/s          18%           --         -53%
    simple_regex 125000/s         150%         112%           --
    
  3. or download this
    my @lines = <DATA>;
    cmpthese(10000, {
    ...
    splitjoin    63.2/s           --         -93%         -94%
    simple_regex  929/s        1368%           --         -15%
    idxsplitjoin 1092/s        1627%          18%           --