Exercise: Subroutines


Take the solution from the subroutines chapter (examples/files-perl/statistics.pl) and move the code in a subroutine called main()

Take the solution from the subroutines chapter ( examples/files-perl/write_report_to_file.pl ) and create 3 subroutines. read_file() and write_file() for the two main parts of the script and main() that will call these two subroutines.

Take ( examples/arrays/color_selector.pl ) and create two functions. One that handles the case when the user provided a value on the command line, and another function that shows the menu and accepts the value from there. Maybe also add a main() function to wrap the rest of the code as well.