quotescan.pl -- Scan for Excessively Long Quoted Strings

quotescan.pl is a Perl program to scan through a text file looking for double- or single-quoted strings and report those which are longer than a defined number of characters (default=40). The output consists of the line number of the long quote, the length of the quoted text, the actual line containing the quoted text, and at the end of the run a summary of the number of lines with excessive length, the number of lines in the file, and the location and length of the longest quote.


Assuming this program is executable its commandline is:

quotescan.pl [-l#] [filename...]


-l# is the number of characters within quotes to search for
filename... is(are) the text file(s) to be processed

An example run is shown below.

~> quotescan test.txt

   Page  1

   quotescan: Find long quoted text
   by Kent Nassen, v1.8, 10/22/99
   Scanning for quoted text longer than 40 characters in the file 'test.txt'

   Line#     Length                   Line Contents/*** Message
  -------   --------  ----------------------------------------------------------
        1        42   v3 "This is a longer label for the variable v3"
        2        61   v4 "This is a very long label for the fourth variable w...
        3        70   v5 'This is a single-quoted label for the fifth variabl...

    There were 3 lines in 'test.txt'
    3 lines had quoted text over 40 characters long.
    The length of the longest quoted text found was 70 characters at line 3.

Back to Kent's Perl Page