Hi Respected Monks,

        I have been assigned a task to open a File which contains of some lines of code ( rules not much to worry about) and the main ones are the include lines which is nothing but as

include "/opt/netcool/etc/rules/include-snmptrap/adaptec-AdaptecArray +Controller-MIB.include.snmptrap.rules" include "/opt/netcool/etc/rules/include-snmptrap/adaptec-C +IOMIB.include.snmptrap.rules" include "/opt/netcool/etc/rules/include-snmptrap/adaptec-C +YCLONE-MIB.include.snmptrap.rules" include "/opt/netcool/etc/rules/include-snmptrap/allentele +com-ALLENTELECOM-MIB.include.snmptrap.rules"

        So these kind of include statements which consists of path about another device rules file and we have to open this file i.e think we have got the first inlcude statement from the file since its a inlcude statement grep out the complete file path and Open this file and see if it too contins any other inlcude statements in it if it has open them too and if it does not then start BAcking up the File and then agian back track and back up the main file too... So back up all the file ...........

        So what i went for the solution is used up a Recursive type of method but my sir says that IF in the first file there r "n" number of inlcude statements and in the first inlcude statemanet after u open it agiang think there are another "n" inlcude statements then the completxity of the program would be come to order of O(n2) n square so he wants to reduce the complexity to O(n log n) and proposed me to go for THREADS but i did not feel the complexity would be reduced but the Memoru allocation and time complexity would be imporved ....

        So monks i need ur suggestions is there any other idea or we have to go by the recursive on or by the Threaded concpets.

Work Hard Party Harderrr!!
Sushil Kumar

In reply to Includes within includes by msk_0984

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.