[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Enabling/using Perl 5.10+ functions: say(), state(), given/switch and "'use strict' by default"

Hi all,

In the comments to his PR (https://github.com/ledgersmb/LedgerSMB/pull/2695#issuecomment-300053021), Rob suggests we should start using

use v5.14;

in our code, as we defined that our minimal Perl version is 5.14 as of 1.6.

While our cpanfile indeed should include that statement, I'm less sure our code should actually contain it too (which is what Rob proposes).

I'm taking this discussion out of the PR comments as I think it may go unnoticed there, but the topic is generally more important than the heading it caries there, as that statement also means that we will automatically enable:

* use strict;
* availability of the functions say() and state()
* availability of the switch/given construct.

(As indicated in: https://www.effectiveperlprogramming.com/2010/07/watch-out-for-side-effects-with-use-version/)

So, the question: do we want to use the 'use VERSION;' statement to set the minimal Perl version, with the indicated side-effects?



http://efficito.com -- Hosted accounting and ERP.
Robust and Flexible. No vendor lock-in.
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Ledger-smb-devel mailing list