Monday hints, August 5th Control Break HELP, email note.

VIP: URL for your last PERL project email

  1. NEW AUGUST 2nd: More hints and explanation on the filtering of records, deciding whether to KEEP for movies report output or not.

  2. NEW: Very useful nested OL list and sorting examples to study and imitate and adopt ideas from. This is class36.html Wednesday, July 31st lecture review.

  3. Example screensnapshots of the FORM GUI and the results pages:

    • Query ascending, 3 fields search for Z. The quote field, actor field or the actress field must contain a Z for the record to be selected.
    • Result of submitted query.

    • Query DESCending, 1 field search for occurrence of letter Z as pattern. Criteria is that the movie title must contain the letter Z.
    • Result of submitted query. Note the descending order by movie name order.

  4. Here is an example of the FORM request which prints all of the database information, including all of the movie quotes, but with the movie name only printed ONCE. The user can specify having it shown with:

  5. Previous email: You might see many ideas that ARE NOT required. You certainly may feel free to add any of or all of them to the assignment and.or come up with more of your own.
    You are always welcome to go above and beyond the requirements of the assignment, if you want an extra challenge beyond the one provided.

  6. How did I get the movies sorted into ascending order by movie title? Used shift to get the movie quote out of the record, then used push to put it back as the LAST field in the record. This left the film name as the FIRST field in the record. The fields were now JOINED back together into a tab separated string, and the string records were each stored in an ARRAY. Then this array was sorted. Since the movie name was the first thing in each string, the sorting sorts all records into ascending order by MOVIE TITLE.

    Go look at PERL/CGI script movies output now, and think about these issues and coding tasks.

          $movieQuote = shift(@record);
          $record[0] =~ tr/\"//d;      # "Good Morning, Vietnam" - bye bye "
          push(@record, $movieQuote);    
    
          Recall original order of the fields in the moviesPERL.txt
          file is as follows:
    
             famousLine    film    LeadActor    LeadActress    Category
    
          After the shift and the push, the order would be:
                    -----         ----
    
              film    LeadActor    LeadActress    Category    famousLine
    
          $movieQuote = shift(@record);      # SHIFT - from the front famousLine
          push(@record, $movieQuote);        #  PUSH - on the back famousLine
    
          Note that the order of the fields in the array @record
          would now be:
    
              film    LeadActor    LeadActress    Category    famousLine
    
          Suppose we join the separated elements back together,
             by tabs, as before they were split 
                  and as they are in the file (Tab delimited fields):
    
          $rec = join(/\t/, @record);
    
          $m[$n++] = $rec;  # store the record into an array, say @m.
    
          Now if you later do these next two statements, the entire set of
             database records will be stored in the array @m in descending
             sorted order, sorted from Z to A by movie name.
    
          @m = sort(@m);
          @m = reverse(@m);