Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 pondering the Monastery: (12)
As of 2015-07-03 18:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (55 votes), past polls