Hi, I hope this is the right forum for my question. I think I start my journey into the world of Perl with this problem. There is an existing code base and my team has made some enhancements to it, spreading across files in different directories, all under one directory (/usr/src). The code added, if it is multiple lines, is between comment tags (LM-2006-01), as shown below.
/* LM-2006-01 */ code modification spawning more than 1 line. /* LM-2006-01 */
If the code enhancement is only one line, the above comment tag succeeds the code in the same line, as shown below.
int my_var; /* LM-2006-01 */
I want to count the total number of lines that I have modified across the files. Also I do not want to count the comment lines, C style comments, embedded inside the code modifications and I do not want to count lines if it has only "{" or "}". What is the best tool for it? Perl, sed, awk? If it is Perl, can someone just give me hints as to what keywords should I look for in Perl tutorials to get started. If any other tool is well suited, I would really appreciate it if I can be redirected to a proper forum or if I can be given some hints. I don't have the option of using Python. Thanks a lot. Anoop.

In reply to Best tool for my requirements? by anoopsaxena76

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.