home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / perl / perl_1 / Perl5001 / pl / checkfor < prev    next >
Encoding:
Text File  |  1996-03-04  |  301 b   |  13 lines

  1. print "Word to check:";
  2. $word = <STDIN>;chomp $word;
  3. print "Checking files in CSD for \"$word\".\n";
  4. foreach $oneof ( sort <*> ) {
  5.     print "\nOpening $oneof\n";
  6.     open (FILE,$oneof) || warn("Can't open $oneof\n");
  7.     while (<FILE>) {
  8.         chop;
  9.         if (/$word/) { print "\n\"$oneof\", line $.: $_"; };
  10.         }
  11.     }
  12.  
  13.