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

Shouldn't LITERAL references be readonly? (updated)

by LanX (Saint)
on Aug 04, 2020 at 17:18 UTC ( [id://11120285]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
     DB<18> use Scalar::Util qw/readonly/
    
    ...
      1
      1
     DB<26>
    
  2. or download this
      DB<32> x map { $_ = 1 } "str"
    Modification of a read-only value attempted at (eval 42)[c:/Perl_524/l
    +ib/perl5db.pl:737] line 2.
    ...
    Modification of a read-only value attempted at (eval 43)[c:/Perl_524/l
    +ib/perl5db.pl:737] line 2.
      DB<34> x map { $_ = 1 } undef
    Modification of a read-only value attempted at (eval 44)[c:/Perl_524/l
    +ib/perl5db.pl:737] line 2.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11120285]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-04-18 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found