in reply to CAN YOU FIGURE THIS OUT?

I really can't stand it when people ask for help and y'all turn on them. Yeah this is obviously a homework problem, but if he's got to ask he's clearly got a teacher who can't teach.

Most any perl tutorial will tell you how to do this, but you have to break it down into simple parts.

First you're going to ask for input. Try this example or search perlmonks

Now you're going to check for bad input. Look here under the while and until section

If you have bad input you're going to send something to STDERR. Here's a place that tells you about STDIN STDOUT AND STDERR

If your input is good you're going to print "Fahrenheit Celcius" (as pointed out above Celsius is misspelled). Here's a A Perl Tutorial: Super-Basics it describes how to print out stuff.

Now you're going to iterate. Check out this tutoral

Now "e" should really be back up when you check for bad input. There is a perlmonks node on How to identify a number datatype in a string?

And now voila you've got a script.

Replies are listed 'Best First'.
Re^2: CAN YOU FIGURE THIS OUT?
by jimbojones (Friar) on Mar 30, 2005 at 14:36 UTC
    This guy didn't ask for help.

    He asked if we could figure out the posted problem. That's a distinction, yes, but an important one. The impression I got reading the OP was that the poster thought that "if I throw this up on this Perl site I just found, maybe someone will bite and give me the answer."

    Now, if the OP had said ... "I'm taking an intro programming class, the teacher is no good, here's my problem, and here's what I've tried so far ... " Even if what he'd tried was "here's the formula for converting F to C".

    I've gotten great responses here to problems that were killing me, and I thank the Monks for that. Asking for help is not the problem. Asking for the Monks to invest effort when the OP hasn't ... that is a problem.

    - jim

Re^2: CAN YOU FIGURE THIS OUT?
by Errto (Vicar) on Mar 30, 2005 at 15:59 UTC
    There's nothing wrong with asking about homework-related issues on Perl Monks. There's nothing wrong with asking for help related to a project you're getting paid for (I've done it). There is something wrong with posting to Perl Monks expecting people to do your work for you. That's what we have here. Big difference.
Re^2: CAN YOU FIGURE THIS OUT?
by Joost (Canon) on Mar 30, 2005 at 16:08 UTC

      The original post does not say anything about the teacher. Being picky, we can not even know the student's character from it. Is he lazy? Maybe he/she is so confused by the problem not knowing even what precisely to ask (the teacher) to get more clarity?

      Anyway, there have been some very good answers with hints and links, like the step-by-step post. After all, it's a valuable answer if the OP does want to take some effort, no matter if he/she has been too lazy, not intelligent enough, or a bad teacher's student.

      By the way, the node's title is really silly.

Re^2: CAN YOU FIGURE THIS OUT?
by Popcorn Dave (Abbot) on Mar 30, 2005 at 19:47 UTC
    That's really unfair without seeing the teacher in action. If you don't understand an assignment, isn't it up to you to ask the teacher for clarification?

    ++ for your suggestions, and hopefully the OP will take those in to consideration.

    Useless trivia: In the 2004 Las Vegas phone book there are approximately 28 pages of ads for massage, but almost 200 for lawyers.