in reply to Functions in Perl

In the general sense, yes, your solution to the exercise is correct and functional. Many would suggest various tweaks and adjustments for the sake of clarity and/or efficiency, but overall it's good, and as a beginner you seem to be on a good track.

However, I would recommend moving to Learning Perl sooner rather than later. I have nothing against Laura Lemay, but most of the "Learn * in 21 Days" books focus too little on understanding the core topic itself, and leave the reader with limited ability to adapt and improvise.

--rjray

Replies are listed 'Best First'.
Functions in Perl
by bluethundr (Pilgrim) on May 23, 2004 at 04:24 UTC
    Thanks man! I fully plan on reading that book! Everyone's been recommending it to me everywhere I turn! I generally trust O'Reilly's offerings to begin with. But I figure, it can't exactly hurt to finish the book I'm already half way through! Also generally speaking I tend to like to get my feet wet with a Sams 21 Days book and reinforce what I learned through more credible resources. That's how I did it with C++ at any rate, and I had some success there. So I decided that I am going to follow that formula again with Perl.

    Also, I I've found that writers inevitably see the same things in different ways. Obviously, one can never duplicate the exact experience or point of view of another human being! And I find that reading the exact same topic matter, covered from inevitably differing perspectives, has been immeasurably advantageous as a learning strategy.