Hi,

I was wondering if you could help me with a problem my boss has given me to solve and as I am a beginner in perl I am having a few problems. I have to create a perl script that searches through a single dat with one field on each line and what I need it to do is pick out the first 11 lines (as these form one record) of the dat file, then I have to create a search engine where he can type in a keyword, it will read in the dat file and then take all the records with the associated keyword and display them in HTML. I tried downloading and following a search.pl module but the results were not what I needed. The problem seems to be that when I do the search it just picks out and displays the keyword and not the set of records, I can?t seem to get the perl script to take the first 11 lines and put them into a record and then display them in a format that is clear.

Any help would be much appreciated.

Thanks

Jason

Edit kudra, 2001-11-05 Changed title; added markup


In reply to Confused Beginner: searching and displaying information from a dat file by Anonymous Monk

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.