Help for this page

Select Code to Download


  1. or download this
    my %scripts;
    foreach (@lines) {
    ...
        
        $scripts{$script}++;
    }
    
  2. or download this
    my %scripts;
    LINE: foreach my $line (@lines) {
    ...
        
        $scripts{'(unknown)'}++;
    }
    
  3. or download this
    my @known_scripts = (
        "Arabic", "Armenian", "Avestan",
    ...
        "Coptic", "Cuneiform", "Cypriot", "Cyrillic",
        # ...
    );
    
  4. or download this
    Can't find Unicode property definition "Script=Chakma" at (...) line (
    +...)
    
  5. or download this
    $ for i in 8 10 12 14 16 18 20; do perl scripts.pl scripts-5$i.txt >5$
    +i.lst; done
    $ for i in 8 10 12 14 16 18; do diff --unchanged-line-format= --new-li
    +ne-format=%L 5$i.lst 5$((i+2)).lst >5$((i+2)).new; done
    $
    
  6. or download this
    #!/usr/bin/perl
    
    ...
    
    $, = "\n";
    say sort { $a cmp $b } map { $_ = ucfirst lc; $_ =~ s/(?<=_)(.)/uc $1/
    +ge; qq/"$_"/ } keys %scripts;
    
  7. or download this
    # New Unicode scripts added in Perl 5.xx
    my %uniscripts = (
    ...
    }
    
    print STDERR "Running on Perl $^V, ", scalar @known_scripts, " scripts
    + known.\n";
    
  8. or download this
    # tentative!
        '22' => [
    ...
            "Old_Permic", "Pahawh_Hmong", "Palmyrene", "Pau_Cin_Hau",
            "Psalter_Pahlavi", "Siddham", "Tirhuta", "Warang_Citi"
        ],
    
  9. or download this
    print "Found " . scalar keys(%scripts) . " scripts:\n";
    print "\t$_: " , $scripts{$_}, " line(s)\n" foreach(sort { $a cmp $b }
    + keys %scripts);
    
  10. or download this
    Running on Perl v5.14.2, 95 scripts known.
    Found 18 scripts:
    ...
            Tamil: 4 line(s)
            Telugu: 1 line(s)
            Thai: 1 line(s)