Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Help with Perl movie database engine assignment

Replies are listed 'Best First'.
Re: Help with Perl movie database engine assignment
by dragonchild (Archbishop) on Nov 22, 2003 at 02:54 UTC
    Why don't you post what you've thought of and what problems you're running into? We prefer dealing with specific issues, not "Help me, I'm clueless!".

    That said, here are a few pointers for general programming methodology:

    1. Rewrite the problem description in your own words. If you can't do this, then you don't know what's being asked. (If you don't know what's being asked, you can't solve the problem. This, btw, is the most common problem in the business world.)
    2. Imagine what you would do if computers didn't exist. How would you solve the problem then? If you can't do this, you either:
      • don't have the skills you need to solve the problem with computers
      • are lazy and I don't want to help you
    3. Once you have laid out what you'd do if computers didn't exist, you have an algorithm. Translating an algorithm into a program is relatively simple. If you can't do this, you haven't been paying attention in class.

    Your professor has given you most of the algorithm. You just need to rewrite the problem and you should see what to do.

    (Hint: you will need to make three files - one in HTML, one in Perl, and one as the flatfile database.)

    (Bonus question: Can you merge the three files into two? How about one?)

    ------
    We are the carpenters and bricklayers of the Information Age.

    The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

    ... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

•Re: Sarah
by merlyn (Sage) on Nov 22, 2003 at 02:58 UTC
    I just need some advice on how to start.
    That's best obtained from your professor, not us.

    Either it's something you should have learned, or something that your instructor will want to know you didn't learn. In either case, asking us means that your instructor won't have an accurate view of what you accomplished in class. And your instructor will want to know that for your grade.

    In other words, even asking this question, I'll suggest, is morally equivalent to cheating on a test.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      Besides the moral issue wheter this is concerned cheating or not, it can also get this student in problems.

      I helped out a friend once who had to hand in some Perl homework. The problem was that I'm a selfthaught Perl l-user. I don't obey certain rules (of formatting code for instance) that the student is supposed to use. Besides that, the professor found it slightly odd that this student -who just started the Perl course and wasn't very good at yet- came up with code containing `map` and likes ;)

      --
      B10m
      Interesting response. I'd never consider her question cheating. I wonder why. It's like the internet is this collective hive, which I rely on for so much. . . It would be cheating if I try to pass off someone else's work as my own. I believe that. But if you understand the work, the ideas behind it, what makes that work less your own than someone elses? Obstensibly I think that's silly, but then I think of all the times I learn something from someone else who got their answer from groups google and then I start to wonder: who's an author and what's original these days? I'd say the author's dead and the internet killed him.
Re: Help with Perl movie database engine assignment
by CountZero (Bishop) on Nov 22, 2003 at 07:57 UTC
    I don't see where your problem is.

    You have been given a detailed algoritm, so your problem must be with implementing it.

    Is it with making the HTML-form? If so go and check some basic documentation on how to write a HTML-file.

    It can't be with the flatfile database text file, the instructions are clear.

    Is it the search script? Check the CGI.pm module about getting form-input. For reading a file into an array, check the perl-docs about the diamond-operator (<...>) (HINT: use two arrays, one to hold the movie titles and another to hold the reviews. Or use a hash with the key being the movie title and the review as the value, but then be very sure that there are no duplicate movie titles in your database).For outputting the results into an HTML file, again CGI.pm comes to the rescue.

    That should put you on your way. Let us know what you made of it!

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re: Help with Perl movie database engine assignment
by tilly (Archbishop) on Nov 23, 2003 at 01:13 UTC
    Start with anything that you know that you need.

    Write the reviews.

    Write a function that can read the file and pull up a review.

    Write a script that hooks said function to a web page.

    etc.

    Looking at the whole thing it will always seem impossible. But break it into useful pieces and start doing those pieces. Leave the hard parts for later. More often than not you will find that in the end there were no hard parts.

    The key is to tackle it one thing at a time.

Re: Help with Perl movie database engine assignment
by chanio (Priest) on Nov 22, 2003 at 15:01 UTC
    You could base your code on an existing script! There are lots of them for free.

    My advice:

    • Use Google to search for 'perl movie database'.
    • General-non CPAN scripts normally are not based on modules. Just like school exercises.
    • Don't worry about learning. After choosing the best script you must have got the basical idea. Then, doing some adjustments to your needs is the other learning part (the most difficult).
    • Doing all these, might be more laborious than programming. But it is another fair way of doing the work. To know what to choose, to understand what is required are also important qualities of a programmer.
    And most important: after all these you are going to know if you are going to keep on programming in the future or not!

    I believe that many things must be learned in the monkeys' way: by immitation.

      I believe that this is what the author of the original posting had in mind, a direction. Sometimes we all need a little direction to get started. I can appreciate it as much as the next guy.

      Me, I'm self directed, so does this really apply to me? A question for the eternities.

      Paulster2

A reply falls below the community's threshold of quality. You may see it by logging in.