#!/usr/bin/perl #Program name: perlcom.pl # count the source file's comment lines $filein = $ARGV[0]; while (<>) { if (/^#/ && !/^#!/) { ++$comment_count; } } print ("File \"$filein\" has $comment_count comment lines.\n");