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
In reply to Re: Functions in Perl
by rjray
in thread Functions in Perl
by bluethundr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |