Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] Find missing line from a list of files

Expand Messages
  • Sudarshan Raghavan
    ... The file files.txt contains a list of files, the OP wants to search through these files for missing line . something like this contents of files.txt
    Message 1 of 8 , Aug 29, 2002
    • 0 Attachment
      On Wed, 28 Aug 2002, Jeff 'japhy' Pinyan wrote:

      > Nope.  @ARGV, when used with <>, holds FILENAMES, not contents.
      >
      >   {
      >     local @ARGV = 'files.txt';
      >     while (<>) {
      >       print "$ARGV: $_" if /\bmissing line\b/;
      >     }
      >   }

      The file 'files.txt' contains a list of files, the OP wants to search
      through these files for 'missing line'. something like this
      contents of files.txt
      file1.txt
      file2.txt

      contents of file1.txt
      some stuff here
      missing line
      another missing line

      contents of file2.txt
      some more stuff here
      yet another missing line

      >
      > There's no need to read a file into an array and then iterate over the
      > array.  There's also no need to chomp the lines if you're going to print
      > them with newlines anyway.
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.