/usr/share/perl5/Convert/Units/Length.pm is in libconvert-units-perl 1:0.43-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | package Convert::Units::Length;
require 5.004;
require Exporter;
use vars qw($VERSION $self);
$VERSION = "0.14";
use Convert::Units::Base;
my $self = new Convert::Units::Base
(
# The actual units, relative to each other (in this case, in inches)
{
'centimeter' => 0.3937,
'decameter' => 393.7,
'decimeter' => 3.937,
'foot' => 12,
'hectometer' => 3937,
'inch' => 1,
'kilometer' => 39370,
'meter' => 39.37,
'micrometer' => 0.00003937,
'mile' => 63360,
'millimeter' => 0.03937,
'yard' => 36
},
# Synonyms and abbreviations for these units
{
'm' => 'meter',
'cm' => 'centimeter',
'dm' => 'decimeter',
'km' => 'kilometer',
'mm' => 'millimeter',
'micron' => 'micrometer',
'mi' => 'mile',
'ft' => 'foot',
"\'" => 'foot',
'in' => 'inch',
"\"" => 'inch',
'yd' => 'yard',
'y' => 'yard'
},
# Mulipliers (so we can say "dozen inches" or "sixteenths of an inch")
{
'dozen' => 12,
'quadruple' => 4,
'triple' => 3,
'double' => 2,
'whole' => 1,
'half' => 1/2,
'third' => 1/3,
'quarter' => 1/4,
'eighth' => 1/8,
'twelth' => 1/12,
'sixteenth' => 1/16,
'tenth' => 1/10,
'twentieth' => 1/20,
'fiftieth' => 1/50,
'hundreth' => 1/100,
'single' => 1
},
# The default unit to convert to (when none is specified)
"inch"
);
# A stub for converting units
sub convert
{
return $self->convert_units (@_);
}
# A stub for parsing strings (such as "1 foot, 3 inches")
sub parse
{
return $self->parse_string (@_);
}
1;
__END__
|