Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

(tye)Re4: The Definitive Unit Conversion Script

by tye (Cardinal)
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-09-01 15:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (14 votes), past polls