Help for this page

Select Code to Download


  1. or download this
    use constant CHUNK => 8;
    
    for (my $x = 0; $x < length($str) / CHUNK; ++$x) {
        print substr($str, $x * CHUNK, CHUNK), "\n";
    }
    
  2. or download this
    print substr($str, $_ * CHUNK, CHUNK), "\n"
        for 0 .. length($str) / CHUNK;