#!/usr/athena/bin/perl

open (FI, "$ARGV[1]");

if($ARGV[0] =~ /u/) {
	@chars1 = A..Z;
}
if($ARGV[0] =~ /l/) {
	@chars2 = a..z;
}
if($ARGV[0] =~ /n/) {
	@chars3 = 0..9;
}

while (<FI>) {
		@letters = split(//);
		foreach $let (@letters) {
			$tots{$let} = $tots{$let} + 1;
			$gtot = $gtot + 1;
}
}
$scale = 400/$gtot;
print "\n\n\n";
foreach $h (@chars2, @chars1, @chars3) {
	print"$h";
	$long = $tots{$h} * $scale;
	$length = int $long;
	print "-" x $length;
	print "\n";
}
