-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readonly 2.02+ not working with Storable #27
Comments
I've dug a bit deeper into it, and it appears that the following also fails with the same error message: use Readonly;
Readonly my $a => 1;
Readonly::Clone $a; However, if I change the declaration of the read only scalar to be Is this by design, and is that why you marked it wontfix? |
You're free to fork, repair, and submit a PR. |
This appears to be caused by the STORABLE_freeze functions, and the fact that the 3 sub-packages (Readonly::Scalar, Readonly::Hash and Readonly::Array) are contained within Readonly.pm and not separate packages (the error states that it can't locate Readonly/.pm). I don't know what the solution is, but I also don't know what the reason for including those functions was. |
Further investigation and testing makes me wonder what the point of the STORABLE_freeze functions is, and if they were ever tested. Because commenting them out doesn't seem to break anything, and it makes Storable work again. Is there any reason not to just remove them? |
Pull requests with tests welcome. |
When storing a Readonly variable with
Storable::store
, retrieving the value again usingStorable::retrieve
results in the error message:The following test-script illustrates the problem:
The error also appears for arrays and hashes.
Using Readonly 2.01 works, and it appears that the issue is with the stored value, as Readonly 2.02 can retrieve files stored by Readonly 2.01. Trying to retrieve a file stored by Readonly 2.02, using Readonly 2.01 gives the same error message.
I've bisected the problem, and it appears to be caused by commit 03fea5a
I'm using Perl 5.24 and Storable 2.51.
The text was updated successfully, but these errors were encountered: