in reply to Re: Slightly OT - Matching a strange character
in thread Slightly OT - Matching a strange character
Here's my favorite -- it prints a histogram of byte values in a data stream or file:
And it would be easy to make a couple additions/alterations so that it tabulates utf8 characters instead of bytes.#!/usr/bin/perl use strict; my @ch; while (<>) { $ch[ord()]++ for ( split( // )); } printf "%6d %.2x\n", $ch[$_], $_ for ( grep {$ch[$_]} 0..$#ch );
|
|---|