develooper Front page | perl.perl5.porters | Postings from November 2017

[perl #132488] Storable: add a flag to control 'bless' and 'tie'

Thread Next
Nicolas R .
November 22, 2017 20:28
[perl #132488] Storable: add a flag to control 'bless' and 'tie'
Message ID:
# New Ticket Created by  Nicolas R. 
# Please include the string:  [perl #132488]
# in the subject line of all future correspondence about this issue. 
# <URL: >

I would like to open a discussion and get feedback on a Storable patch that I am considering to submit to blead.
The idea is to introduce a flag in order to let a user disable or not: "bless" and "tie" features from Storable.

You can read the patch online here:

As the patch stands the original behavior is preserved. "bless" and "tie" are enabled when storing/retrieving objects.
We could consider to change (or not) this default value in the future.
For this reason, the patch introduces a constant 'Storable::FLAGS_COMPAT' to guarantee over time a consistent behavior.
	$Storable::flags = Storable::FLAGS_COMPAT;

Then a customer can disable both "bless" and "tie" by setting the flag to 0, in their script (no guarantee that any other dependency
would set it to a different value, but this is something else).
	$Storable::flags = 0; # to disable bless and tie support when 

Or users can simply disable one or the other
	$Storable::flags = Storable::BLESS_OK;
	$Storable::flags = Storable::TIE_OK;

Any concerns about such a patch?
Are you ok with setting the default value to "Storable::BLESS_OK | Storable::TIE_OK" (which is also Storable::FLAGS_COMPAT)?
Would you consider changing the default value in the future?

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About