# No.36 Perl Sample (code key - 5) # Learning Perl: counting the number of lines (行数を数える) # Tomonori Nagano # Last Update: January 18, 2008 # # This file is encoded in Unicode (UTF-8). If you see gibberish characters, # please re-encode the file in utf-8. # # this sample script is simplified for pedagogical purposes. Those who are # interested in advanced Perl programming are encouraged to consult with # relevant sections of "Perl Cookbook" by Christiansen & Torkington while(<>){ # if the file handle is miissing, it reads the first file by default $count++ ; # increase line count every time } print "numLine:\t$count\n" ;