Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^4: How could I check if a variable is 'read-only'?

by kschwab (Vicar)
on Jan 02, 2019 at 14:39 UTC ( #1227922=note: print w/replies, xml ) Need Help??

in reply to Re^3: How could I check if a variable is 'read-only'?
in thread How could I check if a variable is 'read-only'?

There does look like one possibility. Perlguts mentions that with Perl 5.16 and earlier: Copy-on-write (see the next section) shared a flag bit with read-only scalars. So the only way to test whether sv_setsv , etc., will raise a "Modification of a read-only value" error in those versions is: SvREADONLY(sv) && !SvIsCOW(sv)

Scalar::Util doesn't do anything special for 5.16 or earlier, so it could have false positives in that case. Of course, 5.18 (where it's fixed) was released in 2013 :)

  • Comment on Re^4: How could I check if a variable is 'read-only'?

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1227922]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2022-01-17 02:17 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (50 votes). Check out past polls.