I recently taught myself enough Perl to solve a real-world problem*. I'd like to share the scripts, but none of the resources I studied during development prepared me for distribution.
What I'm looking for is links to good info on common practice or standards for cross plattform Perl programs.
Such as (assuming usage on the three major OSes):
How do we implement a neat and 'standard' command line interface?
How should output and logging be handled? stdout? Plain text log file in some standard path? Plain text file in CWD? All of the above?
Is there common standard for documenting / commenting Perl scripts?
*specifically, I wrote Pidgin2Mail (source): a script that parses logs from the multi-protocol FOSS chat client Pidgin, converts them to well formed emails and submits to an inbox of your choice. I use it to keep all my chat logs available in gmail.
The following ten tips come from Perl Best Practices, a new book of Perl coding and development guidelines by Damian Conway. 1. Design the Module’s Interface First The most important aspect of any module is not how it implements the facilities it provides, but the way in which it provides those facilities in the first place.
Easy to start: Perl is a high-level language so it is closer to other popular programming languages like C, C++ and thus, becomes easy to learn for anyone.
But if you're serious about your profession, intuition isn'tenough. Perl Best Practices author Damian Conway explainsthat rules, conventions, standards, and practices not only helpprogrammers communicate and coordinate with one another, they alsoprovide a reliable framework for thinking about problems, and acommon language for expressing solutions.
The CERT Perl Secure Coding standard is still young and growing. The C and Java standards have more than 200 rules in about 20 sections each. The Perl standard currently has slightly more than 30 rules in the following eight sections:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With