Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

(tye)Re4: The Definitive Unit Conversion Script

by tye (Sage)
on Dec 14, 2002 at 06:53 UTC ( #219836=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        my @new= ConvertTo( $toUnits, $fromUnits, @old );
  2. or download this
    #   <--------- inches ---------><----- ft ----->
        my @inches= ConvertTo( 'in', 'ft', 1, 2, 3 );
        # @inches is now ( 12, 24, 36 )
    
  3. or download this
        my $toInFromFt= ConvertTo( 'in', 'ft' );
        while(  <IN>  ) {
            chomp;
            print OUT $toInFromFt->($_), $/;
        }
    
  4. or download this
    my @table = (
        #### temperature
    ...
        # Pick one of the solutions at random: (:
        return split ' ', (@source{@sol})[rand @sol];
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://219836]
help
Chatterbox?
[erix]: that's a good one. I must remember that :P
[stevieb]: I really dislike how perlbrew doesn't list your version of perl if a newer minor version bump has happened. eg: I use 5.24.1, but 5.24.2 is available, hiding my 5.24.1. I may look at this, as I made it display correctly in berrybrew in cases like this
[stevieb]: choroba just gleaned your post about Module::Starter. I use it too, pretty much for every dist I write

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2017-08-18 20:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (310 votes). Check out past polls.

    Notices?