in reply to Looking for pointers or optimizations.
First, you should always explicitly close any filehandle, even if we all know it closes itself at the end of the script, it is good practice to close it as soon as you don't need it. About your elsif and else, you should start them on a new line.
Either:
} elsif ( ... ) { } else { }
or C style:
} elsif ( ... ) { } else { }
But don't mix both in your code! Choose one and always use the same.
Take some space, its free! If readability is important to you, don't be afraid to add empty lines, like before and after a loop statement or a if-elsif-else block.
Also, if you want to learn more, I recommend you read the book Perl Best Practices (O'Reilly). Not only they provide guidelines but also they explain why. Enjoy!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Looking for pointers or optimizations.
by nemesdani (Friar) on Aug 21, 2012 at 13:50 UTC | |
by MidLifeXis (Monsignor) on Aug 21, 2012 at 14:28 UTC | |
by nemesdani (Friar) on Aug 21, 2012 at 14:36 UTC | |
|
Re^2: Looking for pointers or optimizations.
by thmsdrew (Scribe) on Aug 21, 2012 at 14:21 UTC | |
by greengaroo (Hermit) on Aug 24, 2012 at 12:26 UTC |