Re^2: poll ideas quest 2019
by Tux (Canon) on Nov 06, 2019 at 15:40 UTC
|
- use 5.18.3; use warnings;
How many know that 5.12.0 was the first release that implies strict with use version? (well, actually 5.11.0, but I hope nobody is using 5.11.x in production code)
(I don't care what version notation is used)
Enjoy, Have FUN! H.Merijn
| [reply] [d/l] |
Re^2: poll ideas quest 2019
by Eily (Monsignor) on Nov 06, 2019 at 15:40 UTC
|
As mentioned here, there might be some other options including -w and -W for warnings, and the implicit strict with use VERSION, but that would make a lot of possible answers if you were to enumerate all possible combinations...
And to answer the question, I put the more significant first, so version first (optional), because it is actually strict + features + minimal version, then strict (even after a version) because it is more restrictive (but less rewarningsive) than warnings, and at last warnings.
Edit: Oh, and if there's a package name, I always waste a few minutes deciding where I should put it, and then always add it after strict and warnings.
| [reply] |
Re^2: poll ideas quest 2019
by LanX (Saint) on Nov 06, 2019 at 15:40 UTC
|
| [reply] |
|
use strict;
use warnings;
is actually an attempt to
use less brain;
as it's a call for perl to do some of the thinking for you :) | [reply] [d/l] [select] |
|
> is actually an attempt to
> use less brain;
well using brain leads to cleverly freeing brain by outsourcing, don't you think?
Anecdote
I recently tried to ride a full train, but adding two new routines:
- having one eye on my bike
- another eye on my mobile finishing a language lecture
- (a third eye on the pretty lady having her bike stored behind mine)
The effect was that I was so overly multi-tasked when leaving that I left my backpack (including a perl book and my passport) on the upper shelf.
If I had been clever, (and I actually thought about it) I should have kept the backpack on my lap, because that's a no-brainer.°
Lesson: If you change your routine, only do it one step at a time, otherwise fall back to no-brainers.
... and what is programming else than changing (sub-)routines??? ;-)
° Thankfully the only penalty is that I have to waste now 3 hours to recover my backpack from this train's home base in Monnem.
| [reply] |
Re^2: poll ideas quest 2019
by Anonymous Monk on Nov 06, 2019 at 17:40 UTC
|
Some people try to keep their use ...; declarations alphabetically sorted, saying that might help merges when multiple people add different uses... If one was to follow that route, use strict; would come before use warnings;. | [reply] [d/l] [select] |
|
use 5.18.2;
use warnings;
use Carp;
use DB_File;
use DateTime;
use Data::Peek;
use File::Glob;
use XML::Simple;
use Time::HiRes;
use Text::CSV_XS;
use Sys::Hostname;
use Tie::Hash::DBD;
use File::Basename;
use Module::Refresh;
use Module::CoreList;
use HTML::TreeBuilder;
use DateTime::TimeZone;
use Proc::ProcessTable;
use Encode qw(encode decode);
Enjoy, Have FUN! H.Merijn
| [reply] [d/l] |
|
Ah yes, having so many use statements in a single file that you have to sort them to make them manageable, that happens all the time :'(. And having to add a bunch of modules in one go is common enough that two people do it in parallel on a daily basis. So annoying :/
| [reply] |
|
| [reply] |
|