#!/usr/bin/perl -l my @file = <>; print 0+@file; #### $ ./bar.pl data.txt 46 $ wc data.txt 46 36 346 data.txt