From htessmann at control-tec.com Thu May 4 12:34:53 2017 From: htessmann at control-tec.com (Harold Tessmann) Date: Thu, 4 May 2017 15:34:53 -0400 Subject: [Detroit-pm] Seeking advice on using Perl in a professional way Message-ID: Hi from YpsiArbor/Allen Park, I'm looking to productionize some Perl scripts, and as such, I want to adopt more structure than I use in disposable scripts. These scripts would be used within the bounds of my employer, not released to the general public (with maybe one or two exceptions). I know that TIMTOWTDI, but I like the ?sometimes consistency is not a bad thing either? extension when it comes to common problems such as command-line option parsing, and the perldocs don?t go in depth on what people use in the real world. I?m looking for advice on topics including, but not limited to: ? Modern Perl: I like it in general, and I can install it on my team?s machines. Are there reasons I shouldn?t use it? ? Does anybody have a suggestion for a good blank script template? For instance, I know I want "use Modern::Perl 'version';" or "use warnings/strict;", etc., but there?s probably other things I would want in a basic script. I?ve handled this in a sort of ad-hoc manner, growing new scripts based on what I learned from the old, but I?d like to build a good template once and be done with it. I?d also like the template to include documentation, and that raises more questions. Is there a reason to put my pod block near the top vs. the bottom? Getopt::Tiny seems nice, including a feature to automagically build a usage block?should I use that or is there a reason to avoid it? Or is there a better option parser? ? Do you run Perl::Critic on your code? I know I?ll disable some of the rules, but is it more hassle overall than it?s worth? Similarly, PerlTidy: it seems useful for generating HTML versions of documentation, but I write code in a very precise way, such it would take more time to configure it than I would save in reformatting. ? Thus far I haven?t built anything complicated enough to warrant figuring out an object library; I can get by with basic hash-based structures. I?ve read a bit about Moose and Dancer: how do they compare? And what else exists that I should consider? Any advice is greatly appreciated. Thanks, Harold -------------- next part -------------- An HTML attachment was scrubbed... URL: From jrw32982 at yahoo.com Thu May 4 14:56:36 2017 From: jrw32982 at yahoo.com (John Wiersba) Date: Thu, 4 May 2017 21:56:36 +0000 (UTC) Subject: [Detroit-pm] [AnnArbor.pm] Seeking advice on using Perl in a professional way In-Reply-To: References: Message-ID: <611454461.3628885.1493934996482@mail.yahoo.com> Partly, it depends on the target environment you're going to deploy to and how much control you have over that.How many different servers are we talking about in all?? What OS and system perl version are they running?? MS Windows? Can you easily install the modules you want on those servers?? Binary (xs) modules or pure perl?? Presumably you'd want to install those modules to be local to a user acct (local::lib), rather than into the system perl itself. Do you want/need to create a local perl environment (your own compiled perl, rather than the system perl; perlbrew, plenv)? The answers to the above questions may have a large influence on the approach you take.? For small-medium sized scripts on large numbers of diverse servers, sticking with the core modules (e.g. Getopt::Std, Getopt::Long) and pure perl may be just fine.? If you need binary modules, you'll have to take a more complicated approach. In any case, warnings/strict is a must in production code.? Hash-based native objects are fine for smaller projects.If you're going modern, then Moose. From: Harold Tessmann To: AnnArbor-pm at pm.org; Detroit-pm at pm.org Sent: Thursday, May 4, 2017 3:36 PM Subject: [AnnArbor.pm] Seeking advice on using Perl in a professional way Hi from YpsiArbor/Allen Park, I'm looking to productionize some Perl scripts, and as such, I want to adopt more structure than I use in disposable scripts. These scripts would be used within the bounds of my employer, not released to the general public (with maybe one or two exceptions). I know that?TIMTOWTDI,?but I like the ?sometimes consistency is not a bad thing either? extension when it comes to common problems such as command-line option parsing, and the perldocs don?t go in depth on what people use in the real world. I?m looking for advice on topics including, but not limited to: ? Modern Perl: I like it in general, and I can install it on my team?s machines. Are there reasons I shouldn?t use it? ? Does anybody have a suggestion for a good blank script template? For instance, I know I want "use Modern::Perl 'version';" or "use warnings/strict;", etc., but there?s probably other things I would want in a basic script. I?ve handled this in a sort of ad-hoc manner, growing new scripts based on what I learned from the old, but I?d like to build a good template once and be done with it. I?d also like the template to include documentation, and that raises more questions. Is there a reason to put my pod block near the top vs. the bottom? Getopt::Tiny seems nice, including a feature to automagically build a usage block?should I use that or is there a reason to avoid it? Or is there a better option parser? ? Do you run Perl::Critic on your code? I know I?ll disable some of the rules, but is it more hassle overall than it?s worth? Similarly, PerlTidy: it seems useful for generating HTML versions of documentation, but I write code in a very precise way, such it would take more time to configure it than I would save in reformatting. ? Thus far I haven?t built anything complicated enough to warrant figuring out an object library; I can get by with basic hash-based structures. I?ve read a bit about Moose and Dancer: how do they compare? And what else exists that I should consider? Any advice is greatly appreciated. Thanks,Harold_______________________________________________ AnnArbor-pm mailing list AnnArbor-pm at pm.org http://mail.pm.org/mailman/listinfo/annarbor-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: