in reply to open and read text file
Hello hchana,
Welcome to the monastery. Try this:
Execute it as perl <name.pl> <filename>
#!usr/bin/perl use strict; use warnings; while (<>) { print "$.\t$_"; # updating $. $.\t$_ } continue { close ARGV if eof; }
Update: Adding line output from ($.) to ($.\t$_).
Read more here eof.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: open and read text file
by hchana (Acolyte) on Nov 09, 2017 at 15:27 UTC |