Course of Raku / Advanced / Modules / Modules basics / Exercises
Use the converter
Problem
You are given a module in a file
Temperature.rakumod:
unit module Temperature;
sub c-to-f($c) is export {
$c * 9/5 + 32
}Write a separate program that uses this module to convert a Celsius temperature — passed as a command-line argument — to Fahrenheit and print the result.
Example
$ raku -I. temperature.raku 100
212Solution
Course navigation
← Solution: Two functions in one module | Solution: Use the converter →