The first examples in Learning Perl concentrate more on the feel of the language, and not on the tools that help you write better programs more quickly. Keep reading, and don't use stuff from later chapters on earlier code. You're trying to be too smart too early. {grin}