Help for this page

Select Code to Download


  1. or download this
    ($chunk) = substr($string,0,201) =~ /(.*)\s+\w*$/',
  2. or download this
    Benchmark: running Hofmator, MZSanford, japhy, tye, each for at least 
    +3 CPU seconds...
      Hofmator:  3 wallclock secs ( 2.99 usr +  0.01 sys =  3.00 CPU) @ 20
    +6100.67/s (n=618302)
     MZSanford:  4 wallclock secs ( 3.03 usr +  0.00 sys =  3.03 CPU) @ 55
    +936.63/s (n=169488)
         japhy:  4 wallclock secs ( 3.00 usr +  0.00 sys =  3.00 CPU) @ 25
    +6036.67/s (n=768110)
           tye:  4 wallclock secs ( 3.00 usr +  0.00 sys =  3.00 CPU) @ 29
    +2146.67/s (n=876440)
    
  3. or download this
    #!/usr/bin/perl
    use Benchmark qw/timethese/;
     
    ...
        japhy     => '($chunk) = $string =~ /^(.{1,200})(?<!\s)(?!\w)/;',
        tye       => '($chunk) = $string =~ /^(.{0,199}\S)\s/',
    });