Skip to content
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() behaves differently than Readonly::Scalar() with caller localization #17

Open
ahmogit opened this issue Dec 25, 2015 · 0 comments

Comments

@ahmogit
Copy link

ahmogit commented Dec 25, 2015

The following behavior is observed with perl 5.20.0 and Readonly 2.00.

Defining a package scalar like so:

Readonly::Scalar our $myvar1 => 'The Readonly Value of myvar1';

behaves as expected when the caller uses "local($myvar1)" to localize its value. But defining a scalar like this:

Readonly             our $myvar2 => 'The Readonly Value of myvar2';

results in "attempt to modify read-only value" error at runtime when the caller does "local($myvar2)".

I read the doc concerning the differences between the two forms, but not clear why they should behave differently with localization. Is this a bug or user braindamage?

Minimal example attached.

example.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant