#!/usr/local/bin/perl

$count = 1;
while ($count <= @ARGV) {
        print ("File $ARGV[$count-1]:");
        if (!(-e "$ARGV[$count-1]")) {
                print (" does not exist\n");
        } else {
                if (-r "$ARGV[$count-1]") {
                        print (" read");
                }
                if (-w "$ARGV[$count-1]") {
                        print (" write");
                }
                if (-x "$ARGV[$count-1]") {
                        print (" execute");
                }
                print ("\n");
        }
        $count++;
}
