Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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?
[GotToBTru]: you could, yes
[GotToBTru]: whether or not it would be the best tool for that job .. that is another question

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2017-02-22 18:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (335 votes). Check out past polls.