A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Histogram with perl

perl -lane'($i) = $F[4] =~ m{(\d+)\.}; $m=100; $s=10; for ($c=0; $c<=$m; $c+=$s) { if (($i >= $c) && ($i < $c+$s)) { $h{$c}++; } };END{ for ($c=0; $c<=$m; $c+=$s) { print "$c : ".("#" x $h{$c}); }}'

$i = the value with which you want to make a histogram

$h = hashref holding the histogram data
$s = histogram step size
$m = maximum histogram value

$c = loop counter