[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NFC: Fun with Linux - c2f



#!/usr/bin/perl
#
# Name:     c2f
# Author:   Chris Hedemark <chris at yonderway_com>
# License:  BSD
# Purpose:  Quick converter from centigrade to fahrenheit

main();

sub main {
c2f_prep();
c2f_conv();
c2f_report();
}

sub c2f_prep {
if (!@ARGV) {die "\n"}
$cent = $ARGV[0];
}

sub c2f_conv {
$fahr = $cent * 9 / 5 + 32;
}

sub c2f_report {
print "$fahr\n";
}