#! /usr/bin/perl

# check they supplied the filename
my $args = scalar @ARGV;

# see which pattern the filename matches
if ( $args == 1) {
   my $file = $ARGV[0];
   if ($file =~ m/.*\.sh/)
   { print "script\n"; }
   elsif ($file =~ m/.*\.(cpp|cc|C)/)
   { print "c++\n"; }
   elsif ($file =~ m/(\/)(.*)/)
   { print "absolute path\n"; }
   elsif ($file =~ m/[rR][eE][aA][dD][mM][eE]/)
   { print "readme\n"; }
   else
   { print "plain file" }
} else {
   print "correct usage is $0 filename"
}
print "\n";


