open (FILE, "<file.txt"); while (<FILE>) { if ($_ eq "apple\n") { $count++ } } close (FILE);
you got the result at $count have a nice day =) ----- Original Message ----- From: "Mark Mclogan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, December 29, 2001 5:36 AM 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? > > Over > > MMClogan > > > _________________________________________________________________ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]