#!/usr/bin/perl ## put your file name in below $your_file="file name goes here"; ## open in, "$your_file" or die "could not open $your_file\n"; ## loops through file while () { $line_count++; ## in the line below put the text to search for between the / and / print "$line_count - $_" if (/text to find/); }