> -----Original Message----- > From: Mark Mclogan [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 28, 2001 4:37 PM > To: [EMAIL PROTECTED] > Subject: Question!! number of line.... > > > > How I can know in that I number of line finds a word in a text file?. > For example, a file "file.txt" contains the following list: > > Chocolate > Cake > Cheese > Apple > orange > melon > lemon > > How I can know in that line number is the Apple word?
Use the $. variable: perl -lne 'print $. if /Apple/' file.txt perldoc perlvar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]