|Perl Monk, Perl Meditation|
Of course, this kind of an approach presupposes that you know the programming language very well, or at least are familiar with a wide range of different concepts.
When I was still taking first steps into programming in Pascal and C, I used to write a program that queries the user for a radius, then prints the circumference and area of a circle or sphere. But that was a decade ago.
I mean no offence, but "learning how to write a subroutine or function" in a new programming language sounds silly. It's a matter of syntax, if the programming language has some form of functions or goto. (If it doesn't, this is an interesting problem, but it was already solved in 1950s.) It's much more worth your while to learn a new concept through exposure to a new programming language.
In reply to Re: What do you write when learning a new language?