#!/usr/bin/perl
#Program name: perlread2.pl
#  open disk file, read and display records in the file. Count no. of lines in the file.
$fname = "perlcom.pl";
open(FILEIN, $fname) || warn "Could not open $fname file\n";
while (<FILEIN>)
{
  print "$_";
  ++$line_count;
}
close(FILEIN);
print ("File \"$fname\" has $line_count lines.\n");
