#!/usr/bin/perl

# Coded by Trizen
# Email: echo dHJpemVueEBnbWFpbC5jb20K | base64 -d
# Website: http://trizen.go.ro
# Multi units converter

&mainmenu;

sub mainmenu {
    print "
\t\t
\t\t*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
\t\t>           Multi Units Converter             <
\t\t<                             by Trizen       >
\t\t>                                             <
\t\t<  Options:                                   >
\t\t>             1 - Weight                      <
\t\t<             2 - Temperature                 >
\t\t>             3 - Time                        <
\t\t<             4 - Length                      >
\t\t>             5 - Pressure                    <
\t\t<             6 - Energy                      >
\t\t>             7 - Power                       <
\t\t<             8 - Area                        >
\t\t>             9 - Bandwidth                   <
\t\t...............................................
\t\t<                                             >
\t\t>   [number] -a = CONVERT TO ALL AT ONCE      <
\t\t<                                             >
\t\t*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
\t\t
";
    print "=>> Pick one of...\n> ";
    $pick = <STDIN>;
    chomp $pick;
    if ( $pick eq '' ) {
        &mainmenu;
    }
    if ( $pick eq '1' ) {
        &weight;
    }
    if ( $pick eq '2' ) {
        &temperature;
    }
    if ( $pick eq '3' ) {
        &time;
    }
    if ( $pick eq '4' ) {
        &length;
    }
    if ( $pick eq '5' ) {
        &pressure;
    }
    if ( $pick eq '6' ) {
        &energy;
    }
    if ( $pick eq '7' ) {
        &power;
    }
    if ( $pick eq '8' ) {
        &area;
    }
    if ( $pick eq '9' ) {
        &bandwidth;
    }
    if ( $pick =~ /([0-9]+) -a/ or $pick =~ /([0-9]+)-a/ ) {
        $convert = $1;
        &all;
    }
    if ( $pick =~ /([i,I,v,V,X,x,d,D,c,C,L,l,M,m]+)/ ) {
        &numbers;
    }
}

sub weight {
    print "

..............WEIGHT CONVERTER..............

   Usage: [number] <from> <-to>

Options:
\tall  = convert to all
\tk -g = kilogrammes to grammes
\tg -k = grammes to kilogrammes
\tk -p = kilogrammes to pounds
\tp -k = pounds to kilogrammes
\tg -p = grammes to pounds
\tp -g = pounds to grammes
\to -p = ounces to pounds
\tp -o = pounds to ounces
\to -k = ounces to kilogrammes
\tk -o = kilogrammes to ounces
 _________________________________________
|                                         |
|->> Examples:  50 pounds -kilogrammes    |
|               30 kg -p                  |
|               90 o -k                   |
|               1000 gr -pounds           |
|               120 all                   |
|_________________________________________|

";
    print "=>> Insert a command\n> ";
    $convert = <STDIN>;
    chomp $convert;
    if (   $convert =~ /(.+) kg -g/
        or $convert =~ /(.+) k -g/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 1000;
        print "\n\t $in kilogrammes == $out grammes\n";
    }
    if (   $convert =~ /(.+) kg -p/
        or $convert =~ /(.+) k -p/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 2.20462;
        print "\n\t $in kilogrammes == $out pounds\n";
    }
    if (   $convert =~ /(.+) pounds -k/
        or $convert =~ /(.+) p -k/
        or $convert =~ /(.+) pound -k/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 0.453592;
        print "\n\t $in pounds == $out kilogrammes\n";
    }
    if (   $convert =~ /(.+) gr -k/
        or $convert =~ /(.+) g -k/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in / 1000;
        print "\n\t $in grammes == $out kilogrammes\n";
    }
    if (   $convert =~ /(.+) gr -p/
        or $convert =~ /(.+) g -p/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 0.0022;
        print "\n\t $in grammes == $out pounds\n";
    }
    if (   $convert =~ /(.+) p -g/
        or $convert =~ /(.+) pounds -g/
        or $convert =~ /(.+) pound -g/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 453.59237;
        print "\n\t $in pounds == $out grammes\n";
    }
    if (   $convert =~ /(.+) p -o/
        or $convert =~ /(.+) pounds -o/
        or $convert =~ /(.+) pound -o/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 16;
        print "\n\t $in pounds == $out ounces\n";
    }
    if (   $convert =~ /(.+) o -p/
        or $convert =~ /(.+) on -p/
        or $convert =~ /(.+) ounces -p/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 0.0625;
        print "\n\t $in ounces == $out pounds\n";
    }
    if (   $convert =~ /(.+) o -k/
        or $convert =~ /(.+) on -k/
        or $convert =~ /(.+) ounces -k/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 0.02835;
        print "\n\t $in ounces == $out kilogrammes\n";
    }
    if (   $convert =~ /(.+) k -o/
        or $convert =~ /(.+) kilogrammes -o/
        or $convert =~ /(.+) kilograme -o/
        or $convert =~ /(.+) kg -o/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 35.27396;
        print "\n\t $in kilogrammes == $out ounces\n";
    }
    print "\n\n=>> Press ENTER for main menu or press CTRL+C to exit... ";
    $xm = <STDIN>;
    chomp $xm;
    if ( $xm eq '' ) {
        &mainmenu;
    }
}

sub temperature {
    print "

..............TEMPERATURE CONVERTER..............

   Usage: [number] <from> <-to>

Options:
\tall  = convert to all
\tf -c = fahrenheit to celsius
\tc -f = celsius to fahrenheit
\tk -f = kelvin to fahrenheit
\tf -k = fahrenheit to kelvin
\tk -c = kelvin to celsius
\tc -k = celsius to kelvin
 _________________________________________
|                                         |
|->> Examples:  50 f -celsius             |
|               20 c -kelvin              |
|               400 k -c                  |
|               120 all                   |
|_________________________________________|

";
    print "=>> Insert a command\n> ";
    $convert = <STDIN>;
    chomp $convert;
    if (   $convert =~ /(.+) c -f/
        or $convert =~ /(.+) C -f/
        or $convert =~ /(.+) C -F/
        or $convert =~ /(.+) all/ )
    {
        $c2f = $1;
        $F   = $c2f * 1.8 + 32;
        print "\n\t $c2f\302\260C == $F\302\260F\n";
    }
    if (   $convert =~ /(.+) f -c/
        or $convert =~ /(.+) f -C/
        or $convert =~ /(.+) F -C/
        or $convert =~ /(.+) all/ )
    {
        $f2c = $1;
        $C   = ( $f2c - 32 ) * 5 / 9;
        print "\n\t $f2c\302\260F == $C\302\260C\n";
    }
    if (   $convert =~ /(.+) k -c/
        or $convert =~ /(.+) k -C/
        or $convert =~ /(.+) K -C/
        or $convert =~ /(.+) all/ )
    {
        $k2c = $1;
        $K   = $k2c - 273.15;
        print "\n\t $k2c\302\260K == $K\302\260C\n";
    }
    if (   $convert =~ /(.+) c -k/
        or $convert =~ /(.+) c -K/
        or $convert =~ /(.+) C -K/
        or $convert =~ /(.+) all/ )
    {
        $c2k = $1;
        $C   = $c2k + 273.15;
        print "\n\t $c2k\302\260C == $C\302\260K\n";
    }
    if (   $convert =~ /(.+) k -f/
        or $convert =~ /(.+) k -F/
        or $convert =~ /(.+) K -F/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 1.8 - 459.67;
        print "\n\t $in\302\260K == $out\302\260F\n";
    }
    if (   $convert =~ /(.+) k -f/
        or $convert =~ /(.+) k -F/
        or $convert =~ /(.+) K -F/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = ( $in + 459.67 ) * 5 / 9;
        print "\n\t $in\302\260F == $out\302\260K\n";
    }
    print "\n\n=>> Press ENTER for main menu or press CTRL+C to exit... ";
    $xm = <STDIN>;
    chomp $xm;
    if ( $xm eq '' ) {
        &mainmenu;
    }
}

sub time {
    print "

..............TIME CONVERTER..............

   Usage: [number] <from> <-to>

Options:
\tall  = convert to all
\td -y = days to years
\ty -d = years to days
\td -h = days to hours
\th -d = hours to days
\tw -y = weeks to years
\ty -w = years to weeks
\td -w = days to weeks
\tw -d = weeks to days
\td -m = days to minutes
\tm -d = minutes to days
\th -m = hours to minutes
\tm -h = minutes to hours
\tm -s = minutes to seconds
\ts -m = seconds to minutes
\th -s = hours to seconds\t
\ts -h = seconds to hours
\td -s = days to seconds
\ts -d = seconds to days
 _________________________________________
|                                         |
|->> Examples:  20 days -hours            |
|               14 d -h                   |
|               10 ani -saptamani         |
|               3600 seconds -m           |
|               90 minute -ore            |
|               100 all                   |
|_________________________________________|

";
    print "=>> Insert a command\n> ";
    $convert = <STDIN>;
    chomp $convert;
    if (   $convert =~ /(.+) d -y/
        or $convert =~ /(.+) days -y/
        or $convert =~ /(.+) zile -a/
        or $convert =~ /(.+) z -a/
        or $convert =~ /(.+) all/ )
    {
        $d2y   = $1;
        $years = $d2y * 0.0027379070069885078;
        print "\n\t $d2y days == $years years\n";
    }
    if (   $convert =~ /(.+) y -d/
        or $convert =~ /(.+) years -d/
        or $convert =~ /(.+) year -d/
        or $convert =~ /(.+) ani -z/
        or $convert =~ /(.+) a -z/
        or $convert =~ /(.+) an -z/
        or $convert =~ /(.+) all/ )
    {
        $y2d  = $1;
        $days = $y2d / 0.0027379070069885078;
        print "\n\t $y2d years == $days days\n";
    }
    if (   $convert =~ /(.+) d -h/
        or $convert =~ /(.+) days -h/
        or $convert =~ /(.+) day -h/
        or $convert =~ /(.+) zile -o/
        or $convert =~ /(.+) z -o/
        or $convert =~ /(.+) all/ )
    {
        $d2h   = $1;
        $hours = $d2h * 24;
        print "\n\t $d2h days == $hours hours\n";
    }
    if (   $convert =~ /(.+) h -d/
        or $convert =~ /(.+) hours -d/
        or $convert =~ /(.+) ore -z/
        or $convert =~ /(.+) o -z/
        or $convert =~ /(.+) all/ )
    {
        $h2d  = $1;
        $days = $h2d / 24;
        print "\n\t $h2d hours == $days days\n";
    }
    if (   $convert =~ /(.+) w -y/
        or $convert =~ /(.+) weeks -y/
        or $convert =~ /(.+) saptamani -a/
        or $convert =~ /(.+) s -a/
        or $convert =~ /(.+) all/ )
    {
        $w2y   = $1;
        $years = $w2y / 52;
        print "\n\t $w2y weeks == $years years\n";
    }
    if (   $convert =~ /(.+) y -w/
        or $convert =~ /(.+) years -w/
        or $convert =~ /(.+) ani -s/
        or $convert =~ /(.+) a -s/
        or $convert =~ /(.+) all/ )
    {
        $y2w   = $1;
        $weeks = $y2w * 52;
        print "\n\t $y2w years == $weeks weeks\n";
    }
    if (   $convert =~ /(.+) d -w/
        or $convert =~ /(.+) days -w/
        or $convert =~ /(.+) day -w/
        or $convert =~ /(.+) zile -s/
        or $convert =~ /(.+) z -s/
        or $convert =~ /(.+) all/ )
    {
        $d2w   = $1;
        $weeks = $d2w * 0.142857142857143;
        print "\n\t $d2w days == $weeks weeks\n";
    }
    if (   $convert =~ /(.+) w -d/
        or $convert =~ /(.+) weeks -d/
        or $convert =~ /(.+) week -d/
        or $convert =~ /(.+) saptamani -z/
        or $convert =~ /(.+) s -z/
        or $convert =~ /(.+) all/ )
    {
        $w2d  = $1;
        $days = $w2d / 0.142857142857143;
        print "\n\t $w2d weeks == $days days\n";
    }
    if (   $convert =~ /(.+) h -m/
        or $convert =~ /(.+) hours -m/
        or $convert =~ /(.+) ore -m/
        or $convert =~ /(.+) o -m/
        or $convert =~ /(.+) all/ )
    {
        $h2m     = $1;
        $minutes = $h2m * 60;
        print "\n\t $h2m hours == $minutes minutes\n";
    }
    if (   $convert =~ /(.+) m -h/
        or $convert =~ /(.+) minutes -h/
        or $convert =~ /(.+) minute -o/
        or $convert =~ /(.+) m -o/
        or $convert =~ /(.+) all/ )
    {
        $m2h   = $1;
        $hours = $m2h / 60;
        print "\n\t $m2h minutes == $hours hours\n";
    }
    if (   $convert =~ /(.+) m -d/
        or $convert =~ /(.+) minutes -d/
        or $convert =~ /(.+) minute -z/
        or $convert =~ /(.+) m -z/
        or $convert =~ /(.+) all/ )
    {
        $m2d  = $1;
        $days = $m2d / 1440;
        print "\n\t $m2d minutes == $days days\n";
    }
    if (   $convert =~ /(.+) d -m/
        or $convert =~ /(.+) days -m/
        or $convert =~ /(.+) zile -m/
        or $convert =~ /(.+) z -m/
        or $convert =~ /(.+) all/ )
    {
        $d2m     = $1;
        $minutes = $d2m * 1440;
        print "\n\t $d2m days == $minutes minutes\n";
    }
    if (   $convert =~ /(.+) m -s/
        or $convert =~ /(.+) minutes -s/
        or $convert =~ /(.+) minute -s/
        or $convert =~ /(.+) all/ )
    {
        $m2s     = $1;
        $seconds = $m2s * 60;
        print "\n\t $m2s minutes == $seconds seconds\n";
    }
    if (   $convert =~ /(.+) s -m/
        or $convert =~ /(.+) seconds -m/
        or $convert =~ /(.+) secunde -m/
        or $convert =~ /(.+) all/ )
    {
        $s2m     = $1;
        $minutes = $s2m / 60;
        print "\n\t $s2m seconds == $minutes minutes\n";
    }
    if (   $convert =~ /(.+) h -s/
        or $convert =~ /(.+) hours -s/
        or $convert =~ /(.+) ore -s/
        or $convert =~ /(.+) o -s/
        or $convert =~ /(.+) all/ )
    {
        $h2s     = $1;
        $seconds = $h2s * 3600;
        print "\n\t $h2s hours == $seconds seconds\n";
    }
    if (   $convert =~ /(.+) s -h/
        or $convert =~ /(.+) seconds -h/
        or $convert =~ /(.+) secunde -o/
        or $convert =~ /(.+) s -o/
        or $convert =~ /(.+) all/ )
    {
        $s2h   = $1;
        $hours = $s2h / 3600;
        print "\n\t $s2h seconds == $hours hours\n";
    }
    if (   $convert =~ /(.+) s -d/
        or $convert =~ /(.+) seconds -d/
        or $convert =~ /(.+) secunde -z/
        or $convert =~ /(.+) s -z/
        or $convert =~ /(.+) all/ )
    {
        $s2d  = $1;
        $days = $s2d / 86400;
        print "\n\t $s2d seconds == $days days\n";
    }
    if (   $convert =~ /(.+) d -s/
        or $convert =~ /(.+) days -s/
        or $convert =~ /(.+) day -s/
        or $convert =~ /(.+) zile -s/
        or $convert =~ /(.+) z -s/
        or $convert =~ /(.+) all/ )
    {
        $d2s     = $1;
        $seconds = $d2s * 86400;
        print "\n\t $d2s days == $seconds seconds\n";
    }
    print "\n\n=>> Press ENTER for main menu or press CTRL+C to exit...";
    $xm = <STDIN>;
    chomp $xm;
    if ( $xm eq '' ) {
        &mainmenu;
    }
}

sub length {
    print "

..............LENGTH CONVERTER..............

   Usage: [number] <from> <-to>

Options:
\tall   = convert to all
\tmi -k = miles to kilometres
\tk -mi = kilometres to miles
\tme -k = metres to kilometres
\tk -me = kilometres to metres
\tf -m  = feet to metres
\tm -f  = metres to feet
\ti -c  = inches to centimetres
\tc -i  = centimetres to inches
\ti -m  = inches to metres
\tm -i  = metres to inches
\ty -m  = yards to metres
\tm -y  = metres to yards
\ty -c  = yards to centimetres
\tc -y  = centimetres to yards
\ty -k  = yards to kilometres
\tk -y  = kilometres to yards
 _________________________________________
|                                         |
|->> Examples:  20 miles -kilometres      |
|               90 km -me                 |
|               124 f -mi                 |
|               17 inches -cm             |
|               10 y -me                  |
|               100 all                   |
|_________________________________________|

";
    print "=>> Insert a command\n> ";
    $convert = <STDIN>;
    chomp $convert;
    if (   $convert =~ /(.+) mi -k/
        or $convert =~ /(.+) miles -k/
        or $convert =~ /(.+) mile -k/
        or $convert =~ /(.+) ml -k/
        or $convert =~ /(.+) all/ )
    {
        $m2k = $1;
        $km  = $m2k * 1.609344;
        print "\n\t $m2k miles == $km kilometres\n";
    }
    if (   $convert =~ /(.+) km -mi/
        or $convert =~ /(.+) kilometres -ml/
        or $convert =~ /(.+) k -mi/
        or $convert =~ /(.+) km -ml/
        or $convert =~ /(.+) kilometres -ml/
        or $convert =~ /(.+) all/
        or $convert =~ /(.+) kilometrii -mi/
        or $convert =~ /(.+) kilometru -mi/
        or $convert =~ /(.+) kilometri -mi/ )
    {
        $k2m = $1;
        $mi  = $k2m * 0.62137;
        print "\n\t $k2m kilometres == $mi miles\n";
    }
    if (   $convert =~ /(.+) me -k/
        or $convert =~ /(.+) metres -k/
        or $convert =~ /(.+) metrii -k/
        or $convert =~ /(.+) metri -k/
        or $convert =~ /(.+) all/ )
    {
        $m2k = $1;
        $km  = $m2k * 0.001;
        print "\n\t $m2k metres == $km kilometres\n";
    }
    if (   $convert =~ /(.+) km -me/
        or $convert =~ /(.+) kilometres -me/
        or $convert =~ /(.+) k -me/
        or $convert =~ /(.+) kilometri -me/
        or $convert =~ /(.+) all/
        or $convert =~ /(.+) kilometrii -me/ )
    {
        $k2m    = $1;
        $metres = $k2m * 1000;
        print "\n\t $k2m kilometres == $metres metres\n";
    }
    if (   $convert =~ /(.+) ft -m/
        or $convert =~ /(.+) feet -m/
        or $convert =~ /(.+) f -m/
        or $convert =~ /(.+) all/ )
    {
        $f2m    = $1;
        $metres = $f2m * 0.3048;
        print "\n\t $f2m feet == $metres metres\n";
    }
    if (   $convert =~ /(.+) metrii -f/
        or $convert =~ /(.+) meters -f/
        or $convert =~ /(.+) m -f/
        or $convert =~ /(.+) metri -f/
        or $convert =~ /(.+) all/ )
    {
        $m2f  = $1;
        $feet = $m2f * 3.28084;
        print "\n\t $m2f metres == $feet feet\n";
    }
    if (   $convert =~ /(.+) i -c/
        or $convert =~ /(.+) inches -c/
        or $convert =~ /(.+) in -c/
        or $convert =~ /(.+) inchi -c/
        or $convert =~ /(.+) inch -c/
        or $convert =~ /(.+) all/ )
    {
        $i2cm = $1;
        $cm   = $i2cm * 2.54;
        print "\n\t $i2cm inches == $cm centimetres\n";
    }
    if (   $convert =~ /(.+) c -i/
        or $convert =~ /(.+) cm -i/
        or $convert =~ /(.+) centimetrii -i/
        or $convert =~ /(.+) centimetri -i/
        or $convert =~ /(.+) all/ )
    {
        $cm2i   = $1;
        $inches = $cm2i * 0.3937008;
        print "\n\t $cm2i centimetres == $inches inches\n";
    }
    if (   $convert =~ /(.+) i -m/
        or $convert =~ /(.+) inches -m/
        or $convert =~ /(.+) in -m/
        or $convert =~ /(.+) inchi -m/
        or $convert =~ /(.+) inch -m/
        or $convert =~ /(.+) all/ )
    {
        $i2m    = $1;
        $metres = $i2m * 0.0254;
        print "\n\t $i2m inches == $metres metres\n";
    }
    if (   $convert =~ /(.+) m -i/
        or $convert =~ /(.+) metres -i/
        or $convert =~ /(.+) metri -i/
        or $convert =~ /(.+) metrii -i/
        or $convert =~ /(.+) all/ )
    {
        $m2i    = $1;
        $inches = $m2i * 39.370078740157481;
        print "\n\t $m2i metres == $inches inches\n";
    }
    if (   $convert =~ /(.+) y -m/
        or $convert =~ /(.+) yards -m/
        or $convert =~ /(.+) yard -m/
        or $convert =~ /(.+) all/ )
    {
        $y2m    = $1;
        $metres = $y2m * 0.9144;
        print "\n\t $y2m yards == $metres metres\n";
    }
    if (   $convert =~ /(.+) m -y/
        or $convert =~ /(.+) metres -y/
        or $convert =~ /(.+) metri -y/
        or $convert =~ /(.+) metrii -y/
        or $convert =~ /(.+) all/ )
    {
        $m2y   = $1;
        $yards = $m2y * 1.09361333;
        print "\n\t $m2y metres == $yards yards\n";
    }
    if (   $convert =~ /(.+) centimetrii -y/
        or $convert =~ /(.+) centimetres -y/
        or $convert =~ /(.+) cm -y/
        or $convert =~ /(.+) c -y/
        or $convert =~ /(.+) all/ )
    {
        $cm2y  = $1;
        $yards = $cm2y * 0.010936133;
        print "\n\t $cm2y centimetres == $yards yards\n";
    }
    if (   $convert =~ /(.+) yard -c/
        or $convert =~ /(.+) yards -c/
        or $convert =~ /(.+) y -c/
        or $convert =~ /(.+) all/ )
    {
        $y2cm = $1;
        $cm   = $y2cm * 91.44;
        print "\n\t $y2cm yards == $cm centimetres\n";
    }
    if (   $convert =~ /(.+) yard -k/
        or $convert =~ /(.+) yards -k/
        or $convert =~ /(.+) y -k/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in / 1093.6133;
        print "\n\t $in yards == $out kilometres\n";
    }
    if (   $convert =~ /(.+) k -y/
        or $convert =~ /(.+) km -y/
        or $convert =~ /(.+) kilometrii -y/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 1093.6133;
        print "\n\t $in kilometres == $out yars\n";
    }
    print "\n\n=>> Press ENTER for main menu or press CTRL+C to exit... ";
    $xm = <STDIN>;
    chomp $xm;
    if ( $xm eq '' ) {
        &mainmenu;
    }
}

sub pressure {
    print "

..............PRESSURE CONVERTER..............

   Usage: [number] <from> <-to>

Options:
\tall  = convert to all
\tb -p = bars to pascals
\tp -b = pascals to bars
\tb -a = bars to atmospheres
\ta -b = atmospheres to bars
\tp -m = pascals to mm hg
\tm -p = mm hg to pascals
\ta -m = atmospheres to mm hg
\tm -a = mm hg to atmospheres
\ta -p = atmospheres to pascals
\tp -a = pascals to atmospheres
 _________________________________________
|                                         |
|->> Examples:  5 atmospheres -pascals    |
|               750 p -m                  |
|               400 mmhg -p               |
|               89 bars -atmosfere        |
|               120 all                   |
|_________________________________________|

";
    print "=>> Insert a command\n> ";
    $convert = <STDIN>;
    chomp $convert;
    if (   $convert =~ /(.+) b -p/
        or $convert =~ /(.+) bars -p/
        or $convert =~ /(.+) all/ )
    {
        $b2p    = $1;
        $pascal = $b2p * 100000;
        print "\n\t $b2p bars == $pascal pascals\n";
    }
    if (   $convert =~ /(.+) p -b/
        or $convert =~ /(.+) pascal -b/
        or $convert =~ /(.+) pascals -b/
        or $convert =~ /(.+) all/ )
    {
        $p2b  = $1;
        $bars = $p2b / 100000;
        print "\n\t $p2b pascals == $bars bars\n";
    }
    if (   $convert =~ /(.+) a -b/
        or $convert =~ /(.+) atmospheres -b/
        or $convert =~ /(.+) atmosfere -b/
        or $convert =~ /(.+) at -b/
        or $convert =~ /(.+) all/ )
    {
        $a2b  = $1;
        $bars = $a2b * 1.01325;
        print "\n\t $a2b atmoshpheres == $bars bars\n";
    }
    if (   $convert =~ /(.+) b -a/
        or $convert =~ /(.+) bars -a/
        or $convert =~ /(.+) bar -a/
        or $convert =~ /(.+) all/ )
    {
        $b2a         = $1;
        $atmospheres = $b2a * 0.98692;
        print "\n\t $b2a bars == $atmospheres atmospheres\n";
    }
    if (   $convert =~ /(.+) pascal -m/
        or $convert =~ /(.+) pascals -m/
        or $convert =~ /(.+) p -m/
        or $convert =~ /(.+) all/ )
    {
        $p2m = $1;
        $mm  = $p2m * 0.007519;
        print "\n\t $p2m pascals == $mm mm Hg\n";
    }
    if (   $convert =~ /(.+) m -p/
        or $convert =~ /(.+) mm -p/
        or $convert =~ /(.+) mmhg -p/
        or $convert =~ /(.+) all/ )
    {
        $m2p    = $1;
        $pascal = $m2p * 133;
        print "\n\t $m2p mm Hg == $pascal pascals\n";
    }
    if (   $convert =~ /(.+) a -m/
        or $convert =~ /(.+) atmospheres -m/
        or $convert =~ /(.+) at -m/
        or $convert =~ /(.+) atmosfere -m/
        or $convert =~ /(.+) all/ )
    {
        $a2m = $1;
        $mm  = $a2m * 761.84211;
        print "\n\t $a2m atmospheres == $mm mm Hg\n";
    }
    if (   $convert =~ /(.+) m -a/
        or $convert =~ /(.+) mm -a/
        or $convert =~ /(.+) mmhg -a/
        or $convert =~ /(.+) all/ )
    {
        $m2a         = $1;
        $atmospheres = $m2a * 0.001313;
        print "\n\t $m2a mm Hg == $atmospheres atmospheres\n";
    }
    if (   $convert =~ /(.+) a -p/
        or $convert =~ /(.+) at -p/
        or $convert =~ /(.+) atmospheres -p/
        or $convert =~ /(.+) atmosfere -p/
        or $convert =~ /(.+) all/ )
    {
        $a2p     = $1;
        $pascals = $a2p * 101325;
        print "\n\t $a2p atmospheres == $pascals pascals\n";
    }
    if (   $convert =~ /(.+) p -a/
        or $convert =~ /(.+) pascal -a/
        or $convert =~ /(.+) pascals -a/
        or $convert =~ /(.+) all/ )
    {
        $p2a         = $1;
        $atmospheres = $p2a / 101325;
        print "\n\t $p2a pascals == $atmospheres atmospheres\n";
    }
    print "\n\n=>> Press ENTER for main menu or press CTRL+C to exit... ";
    $xm = <STDIN>;
    chomp $xm;
    if ( $xm eq '' ) {
        &mainmenu;
    }
}

sub energy {
    print "

..............ENERGY CONVERTER..............

   Usage: [number] <from> <-to>

Options:
\tall   = convert to all
\tk -c  = kilojoules to calories
\tc -k  = calories to kilojoules
\tkj -k = kilojoule to kilocalories
\tkc -k = kilocalories to kilojoules
\tj -c  = joules to calories
\tc -j  = calories to joules
\tj -k  = joules to kilojoules
\tk -j  = kilojoules to joules
 _________________________________________
|                                         |
|->> Examples:  500 calories -kj          |
|               3050 j -kilocalories      |
|               90 kj -kc                 |
|               120 all                   |
|_________________________________________|

";
    print "=>> Insert a command\n> ";
    $convert = <STDIN>;
    chomp $convert;
    if (   $convert =~ /(.+) k -c/
        or $convert =~ /(.+) kj -c/
        or $convert =~ /(.+) kilojoules -c/
        or $convert =~ /(.+) all/ )
    {
        $k2c      = $1;
        $calories = $k2c * 238.8459;
        print "\n\t $k2c kilojoules == $calories calories\n";
    }
    if (   $convert =~ /(.+) c -k/
        or $convert =~ /(.+) ca -k/
        or $convert =~ /(.+) calories -k/
        or $convert =~ /(.+) all/ )
    {
        $c2k = $1;
        $kj  = $c2k * 0.004187;
        print "\n\t $c2k calories == $kj kilojoules\n";
    }
    if (   $convert =~ /(.+) kj -k/
        or $convert =~ /(.+) kilojoules -k/
        or $convert =~ /(.+) kjo -k/
        or $convert =~ /(.+) all/ )
    {
        $k2k = $1;
        $kc  = $k2k * 0.2388459;
        print "\n\t $k2k kilojoules == $kc kilocalories\n";
    }
    if (   $convert =~ /(.+) kc -k/
        or $convert =~ /(.+) kilocalories -k/
        or $convert =~ /(.+) kca -k/
        or $convert =~ /(.+) all/ )
    {
        $kc2kj = $1;
        $kj    = $kc2kj * 4.1868;
        print "\n\t $kc2kj kilocalorie == $kj kilojoules\n";
    }
    if (   $convert =~ /(.+) j -c/
        or $convert =~ /(.+) joules -c/
        or $convert =~ /(.+) all/ )
    {
        $j2c      = $1;
        $calories = $j2c * 0.2388458955;
        print "\n\t $j2c joules == $calories calories\n";
    }
    if (   $convert =~ /(.+) j -k/
        or $convert =~ /(.+) joules -k/
        or $convert =~ /(.+) all/ )
    {
        $j2k = $1;
        $kj  = $j2k / 1000;
        print "\n\t $j2k joules == $kj kilojoules\n";
    }
    if (   $convert =~ /(.+) kj -j/
        or $convert =~ /(.+) kilojoules -j/
        or $convert =~ /(.+) all/ )
    {
        $k2j = $1;
        $j   = $k2j * 1000;
        print "\n\t $k2j kilojoules == $j joules\n";
    }
    print "\n\n=>> Press ENTER for main menu or press CTRL+C to exit... ";
    $xm = <STDIN>;
    chomp $xm;
    if ( $xm eq '' ) {
        &mainmenu;
    }
}

sub power {
    print "

..............POWER CONVERTER..............

   Usage: [number] <from> <-to>

Options:
\tall   = convert to all
\tw -k  = watts to kilowatts
\tk -w  = kilowatts to watts
\tcp -w = horsepower (CP) to watts
\tw -cp = watts to horsepower (CP)
\tcp -k = horsepower (CP) to kilowatts
\tk -cp = kilowatts to horsepower (CP)
 _________________________________________
|                                         |
|->> Examples:  250 caiputere -watts      |
|               3820 watts -kw            |
|               90 k -c                   |
|               120 all                   |
|_________________________________________|

";
    print "=>> Insert a command\n> ";
    $convert = <STDIN>;
    chomp $convert;
    if (   $convert =~ /(.+) w -k/
        or $convert =~ /(.+) watt -k/
        or $convert =~ /(.+) watts -k/
        or $convert =~ /(.+) all/ )
    {
        $w2k = $1;
        $kw  = $w2k / 1000;
        print "\n\t $w2k watts == $kw kilowatts\n";
    }
    if (   $convert =~ /(.+) k -w/
        or $convert =~ /(.+) kw -w/
        or $convert =~ /(.+) kilowatts -w/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 1000;
        print "\n\t $in kilowatts == $out watts\n";
    }
    if (   $convert =~ /(.+) caiputere -w/
        or $convert =~ /(.+) hp -w/
        or $convert =~ /(.+) cp -w/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 745.7;
        print "\n\t $in horsepower (CP) == $out watts\n";
    }
    if (   $convert =~ /(.+) w -c/
        or $convert =~ /(.+) watt -h/
        or $convert =~ /(.+) watts -h/
        or $convert =~ /(.+) watts -c/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 0.001341;
        print "\n\t $in watts == $out horsepower (CP)\n";
    }
    if (   $convert =~ /(.+) caiputere -k/
        or $convert =~ /(.+) hp -k/
        or $convert =~ /(.+) cp -k/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 0.7457;
        print "\n\t $in horsepower (CP) == $out killowatts\n";
    }
    if (   $convert =~ /(.+) k -c/
        or $convert =~ /(.+) kw -h/
        or $convert =~ /(.+) kilowatts -h/
        or $convert =~ /(.+) kw -c/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 1.3410218729;
        print "\n\t $in kilowatts == $out horsepower (CP)\n";
    }
    print "\n\n=>> Press ENTER for main menu or press CTRL+C to exit... ";
    $xm = <STDIN>;
    chomp $xm;
    if ( $xm eq '' ) {
        &mainmenu;
    }
}

sub area {
    print "

..............AREA CONVERTER..............

   Usage: [number] <from> <-to>

Options:
\tall   = convert to all
\th -ar = hectares to ares
\tar -h = ares to hectares
\th -ac = hectares to acres
\tac -h = acres to hectares
\th -m2 = hectares to square metres
\tm2 -h = square metres to hectares
 _________________________________________
|                                         |
|->> Examples:  2500 ares -hectares       |
|               10 h -acres               |
|               400 m2 -h                 |
|               80 k -a                   |
|               120 all                   |
|_________________________________________|

";
    print "=>> Insert a command\n> ";
    $convert = <STDIN>;
    chomp $convert;
    if (   $convert =~ /(.+) h -ar/
        or $convert =~ /(.+) hectari -ar/
        or $convert =~ /(.+) he -ar/
        or $convert =~ /(.+) hectares -ar/
        or $convert =~ /(.+) hectare -ar/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 100;
        print "\n\t $in hectares == $out ares\n";
    }
    if (   $convert =~ /(.+) a -h/
        or $convert =~ /(.+) ares -h/
        or $convert =~ /(.+) ari -h/
        or $convert =~ /(.+) arii -h/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in / 100;
        print "\n\t $in ares == $out hectares\n";
    }
    if (   $convert =~ /(.+) h -ac/
        or $convert =~ /(.+) hectari -ac/
        or $convert =~ /(.+) he -ac/
        or $convert =~ /(.+) hectares -ac/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 2.47105;
        print "\n\t $in hectares == $out acres\n";
    }
    if (   $convert =~ /(.+) acr -h/
        or $convert =~ /(.+) ac -h/
        or $convert =~ /(.+) acre -h/
        or $convert =~ /(.+) acres -h/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 0.404685;
        print "\n\t $in acres == $out hectares\n";
    }
    if (   $convert =~ /(.+) h -m/
        or $convert =~ /(.+) hectari -m/
        or $convert =~ /(.+) hectare -m/
        or $convert =~ /(.+) he -m/
        or $convert =~ /(.+) hectares -m/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 10000;
        print "\n\t $in hectares == $out m\302\262\n";
    }
    if (   $convert =~ /(.+) m2 -h/
        or $convert =~ /(.+) metrii patrati -h/
        or $convert =~ /(.+) mp -h/
        or $convert =~ /(.+) m -h/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in / 10000;
        print "\n\t $in m\302\262 == $out hectares\n";
    }
    if (   $convert =~ /(.+) h -k/
        or $convert =~ /(.+) hectari -k/
        or $convert =~ /(.+) hectare -k/
        or $convert =~ /(.+) he -k/
        or $convert =~ /(.+) hectares -k/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 0.01;
        print "\n\t $in hectares == $out km\302\262\n";
    }
    if (   $convert =~ /(.+) k -a/
        or $convert =~ /(.+) k2 -a/
        or $convert =~ /(.+) kilometrii patrati -a/
        or $convert =~ /(.+) km2 -a/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 10000;
        print "\n\t $in km\302\262 == $out ares\n";
    }
    if (   $convert =~ /(.+) a -k/
        or $convert =~ /(.+) ares -k/
        or $convert =~ /(.+) ari -k/
        or $convert =~ /(.+) arii -k/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in / 10000;
        print "\n\t $in ares == $out km\302\262\n";
    }
    print "\n\n=>> Press ENTER for main menu or press CTRL+C to exit... ";
    $xm = <STDIN>;
    chomp $xm;
    if ( $xm eq '' ) {
        &mainmenu;
    }
}

sub bandwidth {
    print "

..............BANDWIDTH CONVERTER..............

   Usage: [number] <from> <-to>

Options:
\t[nr] all = convert to all
\tmbps -m  = megabits/s to MB/s
\tMB/s -m  = MB/s to megabits/s
 _________________________________________
|                                         |
|->> Examples:  30 mbps -MB/s             |
|               5 M -m                    |
|               50 all                    |
|_________________________________________|

";
    print "=>> Insert a command\n> ";
    $convert = <STDIN>;
    chomp $convert;
    if (   $convert =~ /(.+) mbps -m/
        or $convert =~ /(.+) mbps -M/
        or $convert =~ /(.+) megabiti -m/
        or $convert =~ /(.+) megabits -m/
        or $convert =~ /(.+) megabit -m/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in / 8;
        print "\n\t $in mbps == $out MB/s\n";
    }
    if (   $convert =~ m[(.+) mb/s -m]
        or $convert =~ m[(.+) MB/s -M]
        or $convert =~ /(.+) MB -m/
        or $convert =~ /(.+) mega -m/
        or $convert =~ /(.+) mb -m/
        or $convert =~ /(.+) M -m/
        or $convert =~ /(.+) all/ )
    {
        $in  = $1;
        $out = $in * 8;
        print "\n\t $in MB/s == $out mbps\n";
    }
    print "\n\n=>> Press ENTER for main menu or press CTRL+C to exit... ";
    $xm = <STDIN>;
    chomp $xm;
    if ( $xm eq '' ) {
        &mainmenu;
    }
}

sub all {
    print "\n\t =>> AREA <<=\n...................................\n\n";
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 100;
        print "-> $in hectares == $out ares\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in / 100;
        print "-> $in ares == $out hectares\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 2.47105;
        print "-> $in hectares == $out acres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 0.404685;
        print "-> $in acres == $out hectares\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 10000;
        print "-> $in hectares == $out m\302\262\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in / 10000;
        print "-> $in m\302\262 == $out hectares\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 0.01;
        print "-> $in hectares == $out km\302\262\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 10000;
        print "-> $in km\302\262 == $out ares\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in / 10000;
        print "-> $in ares == $out km\302\262\n";
        print "...................................\n";
    }
    print "\n\t =>> POWER <<=\n...................................\n\n";
    if ( $convert =~ /([0-9]+)/ ) {
        $w2k = $1;
        $kw  = $w2k / 1000;
        print "-> $w2k watts == $kw kilowatts\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 1000;
        print "-> $in kilowatts == $out watts\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 745.7;
        print "-> $in horsepower (CP) == $out watts\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 0.001341;
        print "-> $in watts == $out horsepower (CP)\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 0.7457;
        print "-> $in horsepower (CP) == $out killowatts\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 1.3410218729;
        print "-> $in kilowatts == $out horsepower (CP)\n";
        print "...................................\n";
    }
    print "\n\t =>> ENERGY <<=\n...................................\n\n";
    if ( $convert =~ /([0-9]+)/ ) {
        $k2c      = $1;
        $calories = $k2c * 238.8459;
        print "-> $k2c kilojoules == $calories calories\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $c2k = $1;
        $kj  = $c2k * 0.004187;
        print "-> $c2k calories == $kj kilojoules\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $k2k = $1;
        $kc  = $k2k * 0.2388459;
        print "-> $k2k kilojoules == $kc kilocalories\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $kc2kj = $1;
        $kj    = $kc2kj * 4.1868;
        print "-> $kc2kj kilocalorie == $kj kilojoules\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $j2c      = $1;
        $calories = $j2c * 0.2388458955;
        print "-> $j2c joules == $calories calories\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $j2k = $1;
        $kj  = $j2k / 1000;
        print "-> $j2k joules == $kj kilojoules\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $k2j = $1;
        $j   = $k2j * 1000;
        print "-> $k2j kilojoules == $j joules\n";
        print "...................................\n";
    }
    print "\n\t =>> PRESSURE <<=\n...................................\n\n";
    if ( $convert =~ /([0-9]+)/ ) {
        $b2p    = $1;
        $pascal = $b2p * 100000;
        print "-> $b2p bars == $pascal pascals\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $p2b  = $1;
        $bars = $p2b / 100000;
        print "-> $p2b pascals == $bars bars\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $a2b  = $1;
        $bars = $a2b * 1.01325;
        print "-> $a2b atmoshpheres == $bars bars\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $b2a         = $1;
        $atmospheres = $b2a * 0.98692;
        print "-> $b2a bars == $atmospheres atmospheres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $p2m = $1;
        $mm  = $p2m * 0.007519;
        print "-> $p2m pascals == $mm mm Hg\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $m2p    = $1;
        $pascal = $m2p * 133;
        print "-> $m2p mm Hg == $pascal pascals\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $a2m = $1;
        $mm  = $a2m * 761.84211;
        print "-> $a2m atmospheres == $mm mm Hg\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $m2a         = $1;
        $atmospheres = $m2a * 0.001313;
        print "-> $m2a mm Hg == $atmospheres atmospheres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $a2p     = $1;
        $pascals = $a2p * 101325;
        print "-> $a2p atmospheres == $pascals pascals\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $p2a         = $1;
        $atmospheres = $p2a / 101325;
        print "-> $p2a pascals == $atmospheres atmospheres\n";
        print "...................................\n";
    }
    print "\n\t =>> LENGTH <<=\n...................................\n\n";
    if ( $convert =~ /([0-9]+)/ ) {
        $m2k = $1;
        $km  = $m2k * 1.609344;
        print "-> $m2k miles == $km kilometres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $k2m = $1;
        $mi  = $k2m * 0.62137;
        print "-> $k2m kilometres == $mi miles\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $m2k = $1;
        $km  = $m2k * 0.001;
        print "-> $m2k metres == $km kilometres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $k2m    = $1;
        $metres = $k2m * 1000;
        print "-> $k2m kilometres == $metres metres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $f2m    = $1;
        $metres = $f2m * 0.3048;
        print "-> $f2m feet == $metres metres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $m2f  = $1;
        $feet = $m2f * 3.28084;
        print "-> $m2f metres == $feet feet\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $i2cm = $1;
        $cm   = $i2cm * 2.54;
        print "-> $i2cm inches == $cm centimetres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $cm2i   = $1;
        $inches = $cm2i * 0.3937008;
        print "-> $cm2i centimetres == $inches inches\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $i2m    = $1;
        $metres = $i2m * 0.0254;
        print "-> $i2m inches == $metres metres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $m2i    = $1;
        $inches = $m2i * 39.370078740157481;
        print "-> $m2i metres == $inches inches\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $y2m    = $1;
        $metres = $y2m * 0.9144;
        print "-> $y2m yards == $metres metres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $m2y   = $1;
        $yards = $m2y * 1.09361333;
        print "-> $m2y metres == $yards yards\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $cm2y  = $1;
        $yards = $cm2y * 0.010936133;
        print "-> $cm2y centimetres == $yards yards\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $y2cm = $1;
        $cm   = $y2cm * 91.44;
        print "-> $y2cm yards == $cm centimetres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in / 1093.6133;
        print "-> $in yards == $out kilometres\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 1093.6133;
        print "-> $in kilometres == $out yards\n";
        print "...................................\n";
    }
    print "\n\t =>> TIME <<=\n...................................\n\n";
    if ( $convert =~ /([0-9]+)/ ) {
        $d2y   = $1;
        $years = $d2y * 0.0027379070069885078;
        print "-> $d2y days == $years years\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $y2d  = $1;
        $days = $y2d / 0.0027379070069885078;
        print "-> $y2d years == $days days\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $d2h   = $1;
        $hours = $d2h * 24;
        print "-> $d2h days == $hours hours\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $h2d  = $1;
        $days = $h2d / 24;
        print "-> $h2d hours == $days days\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $w2y   = $1;
        $years = $w2y / 52;
        print "-> $w2y weeks == $years years\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $y2w   = $1;
        $weeks = $y2w * 52;
        print "-> $y2w years == $weeks weeks\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $d2w   = $1;
        $weeks = $d2w * 0.142857142857143;
        print "-> $d2w days == $weeks weeks\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $w2d  = $1;
        $days = $w2d / 0.142857142857143;
        print "-> $w2d weeks == $days days\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $h2m     = $1;
        $minutes = $h2m * 60;
        print "-> $h2m hours == $minutes minutes\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $m2h   = $1;
        $hours = $m2h / 60;
        print "-> $m2h minutes == $hours hours\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $m2d  = $1;
        $days = $m2d / 1440;
        print "-> $m2d minutes == $days days\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $d2m     = $1;
        $minutes = $d2m * 1440;
        print "-> $d2m days == $minutes minutes\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $m2s     = $1;
        $seconds = $m2s * 60;
        print "-> $m2s minutes == $seconds seconds\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $s2m     = $1;
        $minutes = $s2m / 60;
        print "-> $s2m seconds == $minutes minutes\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $h2s     = $1;
        $seconds = $h2s * 3600;
        print "-> $h2s hours == $seconds seconds\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $s2h   = $1;
        $hours = $s2h / 3600;
        print "-> $s2h seconds == $hours hours\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $s2d  = $1;
        $days = $s2d / 86400;
        print "-> $s2d seconds == $days days\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $d2s     = $1;
        $seconds = $d2s * 86400;
        print "-> $d2s days == $seconds seconds\n";
        print "...................................\n";
    }
    print "\n\t =>> TEMPERATURE <<=\n...................................\n\n";
    if ( $convert =~ /([0-9]+)/ ) {
        $c2f = $1;
        $F   = $c2f * 1.8 + 32;
        print "-> $c2f\302\260C == $F\302\260F\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $f2c = $1;
        $C   = ( $f2c - 32 ) * 5 / 9;
        print "-> $f2c\302\260F == $C\302\260C\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $k2c = $1;
        $K   = $k2c - 273.15;
        print "-> $k2c\302\260K == $K\302\260C\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $c2k = $1;
        $C   = $c2k + 273.15;
        print "-> $c2k\302\260C == $C\302\260K\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 1.8 - 459.67;
        print "-> $in\302\260K == $out\302\260F\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = ( $in + 459.67 ) * 5 / 9;
        print "-> $in\302\260F == $out\302\260K\n";
        print "...................................\n";
    }
    print "\n\t =>> WEIGHT <<=\n...................................\n\n";
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 1000;
        print "-> $in kilogrammes == $out grammes\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 2.20462;
        print "-> $in kilogrammes == $out pounds\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 0.453592;
        print "-> $in pounds == $out kilogrammes\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in / 1000;
        print "-> $in grammes == $out kilogrammes\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 0.0022;
        print "-> $in grammes == $out pounds\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 453.59237;
        print "-> $in pounds == $out grammes\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 16;
        print "-> $in pounds == $out ounces\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 0.0625;
        print "-> $in ounces == $out pounds\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 0.02835;
        print "-> $in ounces == $out kilogrammes\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 35.27396;
        print "-> $in kilogrammes == $out ounces\n";
        print "...................................\n";
    }
    print "\n\t =>> BANDWIDTH <<=\n...................................\n\n";
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in / 8;
        print "-> $in mbps == $out MB/s\n";
    }
    if ( $convert =~ /([0-9]+)/ ) {
        $in  = $1;
        $out = $in * 8;
        print "-> $in MB/s == $out mbps\n";
        print "...................................\n";
    }
    print "\n\n=>> Press ENTER for main menu or press CTRL+C to exit... ";
    $xm = <STDIN>;
    chomp $xm;
    if ( $xm eq '' ) {
        &mainmenu;
    }
}

sub numbers {
    @numere = split( ?undef?, $pick, 0 );
    foreach $final (@numere) {
        if ( $final eq 'i' or $final eq 'I' ) {
            $final = 1;
            print "\t I == $final\n";
        }
        if ( $final eq 'v' or $final eq 'V' ) {
            $final = 5;
            print "\t V == $final\n";
        }
        if ( $final eq 'x' or $final eq 'X' ) {
            $final = 10;
            print "\t X == $final\n";
        }
        if ( $final eq 'l' or $final eq 'L' ) {
            $final = 50;
            print "\t L == $final\n";
        }
        if ( $final eq 'c' or $final eq 'C' ) {
            $final = 100;
            print "\t C == $final\n";
        }
        if ( $final eq 'd' or $final eq 'D' ) {
            $final = 500;
            print "\t D == $final\n";
        }
        if ( $final eq 'm' or $final eq 'M' ) {
            $final = 1000;
            print "\t M == $final\n";
        }
    }
    print "\n\n=>> Press ENTER for main menu or press CTRL+C to exit... ";
    $xm = <STDIN>;
    chomp $xm;
    if ( $xm eq '' ) {
        &mainmenu;
    }
}

