in reply to Generating a "print list"

This is a very general question and would probably require someone to pretty much write your whole program for you, but you have left out too many details. It would help if you showed us what you have so far and any specific problem areas.

Incidentally, it sounds like you are going about this in the wrong way. What you probably want is a database that holds all your information. Then you can just query the database given the user supplied data. That would save you a lot of trouble as far as creating and deleting temporary files.

HTH HAND

Replies are listed 'Best First'.
Re: Re: Generating a "print list"
by SysAdm (Novice) on Mar 09, 2001 at 13:04 UTC
    O.k... here is the code that opens the file and declares the variables...
    sub a { open(DATA, "<$config{'basepath'}/data.out") || die "Can't open file: $ +!"; @lines = <DATA>; close (DATA); $listings = 0; foreach $temp (@lines){ ($num,$date,$desc) = split(/\|/,$temp); if ($num =~ /^123$/) { print "$desc\n"; $listings = 1;} } if ($listings eq "0") {print "There are no listings for "123" at this +time.\n";} }
    The user has a clickable link to see if any '123' listings are in the file..
    <A HREF=$ENV{'SCRIPT_NAME'}?action=a>Click for '123' listings</a><br>
    Example of return if '123' exists:

    Results for '123':

    Apple - Click HERE to add to list
    Pear  - Click HERE to add to list     
    Orange - Click HERE to add to list
    Grapefruit - Click HERE to add to list
    Banana - Click HERE to add to list
    

    I would like to be able to have a link at the end of each return value that would "build" a list of the ones the user wants..

    So if they clicked next to Orange and Grapefruit and they were done searching, they would click a link that would let them print a list that would just have Orange and Grapefruit in it...

    Hope this helps...

    _______SysAdm

    Edit 2001-03-08 by tye

      Sounds like you want a radio group. Check the CGI module for information on how to build radio_groups with it. (You _are_ using CGI.pm, aren't you?).