I see two things in that code that I would suggest to improve:
In Perl, as opposed to Python's "there should be one - and preferably only one - obvious way to do it", TIMTOWTDI - There Is More Than One Way To Do It. While there are certainly 20 different ways to write the code you showed, don't worry about that too much - just keep your eye out for best practices like the ones I mentioned above, and otherwise enjoy learning Perl :-) We'll be happy to help.
Made a few minor edits.
In reply to Re: Idiomatic Perl?
by haukex
in thread Idiomatic Perl?
by thenextfart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |