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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://219836]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-24 22:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found