Help for this page

Select Code to Download


  1. or download this
    sub length_in_grapheme_clusters {
        my $length;
        $length++ while $_[0] =~ m/\X/g;
        return $length;
    }
    
  2. or download this
    sub length_in_grapheme_clusters {
        my $length = () = $_[0] =~ /\X/g;
        return $length;
    }
    
  3. or download this
    sub length_in_grapheme_clusters {
        return 0+( () = $_[0] =~ /\X/g );
    }