in reply to Configuring a Perl script to extract certain records from an ASCII file

That code is just plain broken, or at least is incomplete. If you add use strict; as the second line of the script then fix all the obvious places where my is required, there are still about a dozen variables which are, apparently, used without being initialised. The first, and probably the worst, of these is $cgilib in the second require.

Aside from that, it looks very much like a real database (using SQLite perhaps) is a good solution to your problem. That will require you to learn some Perl or hire a Perl programmer however.

True laziness is hard work
  • Comment on Re: Configuring a Perl script to extract certain records from an ASCII file
  • Download Code

Replies are listed 'Best First'.
Re^2: Configuring a Perl script to extract certain records from an ASCII file
by the-Zoro (Initiate) on May 09, 2011 at 04:07 UTC

    Grandfather, thank you for your reply, I appreciate it very much.

    The initializations occur within the "forum.setup" file. As mentioned, this Perl new.cgi script is currently being used successfully to list the first three (3) messages within the forums specified in the script on the index.shtml web page using a SSI include statement. The script pulls information from a Perl-based forum software which uses ASCII database files (actual fields are shown in the code for reference purposes), not MySQL or any other database, and will be using this software in the future.

    To clarify, I need help in the additional FOR or IF statements which are needed to properly select the moderator(s) records from the three ASCII databases (education, history, and news forums) which this script opens and searches through.

    I hope to find a coding solution to this problem. Thank you again for your message.

    Zoro

      You say you want to filter by author/$lauthor, so use some comparison operator or regex to compare $lauthor to some other variable or string , see perlintro

        Thank you for your suggestion.

        I would like to filter by $name, as that field is the person who posted the initial forum message. I can't figure out the logic needed to display the information like this:

        • display three (3) of the latest forum messages
        • from the forums specified within the script
        • categorized and listed by the authors (moderators) with their pictures, also specified within the script

        Quite honestly, I posted here as I don't have the necessary advanced skills to complete this non-profit volunteer project. Thanks again to the Perl Monks community for your feedback, suggestions and patience. I hope to find a coding solution for this Perl new.cgi program.