Why don't you forget Fahrenheit and Celsius and use the Kelvin scale instead? After all it does place absolute zero at zero and work upwards. You can use a conversion function to change the input to Kelvin and test for the start temp being greater than zero and less than the end temp.

Using Cody Pendants post as inspiration. Implementing the Kelvin / Fahrenheit/Celsius conversion functions and better presentation is left as an exercise for the reader...

#! /usr/bin/perl use strict; use warnings; kelvin (@ARGV); sub kelvin { my $start = $_[0]; my $end = $_[1]; my $inc = $_[2]; if (($start > 0) and ($start < $end)) { print "Fahrenheit Celcius\n"; my $loop = $start; while ($loop < $end) { print $loop, "\n"; $loop = $loop + $inc; } } else { die ("You entered bad arguments dumbass!"); } }

Or just mess with his head...

k2 (@ARGV); sub k2 {s{}{$_[0]-$_[2]}e;while( $_[0]>=0&&$_[0]<$_[1]&&s>([\d.]+)> $1<$_[1]?$1+$_[2]:''>e){print+qq +$_\n+};!$_||die ("Bad Params!")}

In reply to Re: CAN YOU FIGURE THIS OUT? by inman
in thread CAN YOU FIGURE THIS OUT? by PERLVICE

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.