#!/usr/bin/perl
# 
# rot13ident.pl
# Created: Sat Feb 20 20:41:00 1999 by jay.kominek@colorado.edu
# Revised: Sat Feb 20 20:49:29 1999 by jay.kominek@colorado.edu
# This script is in the public domain.
# It was written by Jay Kominek <jay.kominek@colorado.edu> in 1999
# 
#

@data = <>;

$str = join('',@data);

$str =~ s/\W//g;
$str =~ s/\d//g;
$str =~ tr/A-Z/a-z/;

@letters = split//,$str;

foreach(@letters) {
  $count{$_}++;
  $total++;
}

$top    = $count{'i'} + $count{'s'} + $count{'e'} + $count{'t'};
$bottom = $count{'v'} + $count{'f'} + $count{'r'} + $count{'g'};

if( ($top/$total) > ($bottom/$total) ) {
  print "probably plaintext\n";
} else {
  print "probably rot13 text\n";
}
