Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: ref to read-only alias ... why?

by ikegami (Pope)
on Jan 06, 2012 at 01:31 UTC ( #946514=note: print w/ replies, xml ) Need Help??


in reply to ref to read-only alias ... why?

The condition in which "\" copies a scalar is: SvPADTMP(sv) && !IS_PADGV(sv). Not sure that that means. The condition is still there in the latest codebase.

It turns out that whether you get a read-only error or not depends on whether you are using a threaded Perl or not.

Using the lastest codebase:

$ git clean -dfx \ && ./Configure -des -Dusedevel -Dcc='ccache cc' \ && make miniperl ... $ ./miniperl -le'for (1) { my $r = \$_; $$r++; print; print $$r; }' Modification of a read-only value attempted at -e line 1. $ git clean -dfx \ && ./Configure -des -Dusedevel -Dcc='ccache cc' -Dusethreads \ && make miniperl ... $ ./miniperl -le'for (1) { my $r = \$_; $$r++; print; print $$r; }' 1 2


Comment on Re: ref to read-only alias ... why?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2014-09-21 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (165 votes), past polls