X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,c41350f111057a73 X-Google-Attributes: gidf996b,public X-Google-Thread: fa0ae,eb66a30df04c6a5c X-Google-Attributes: gidfa0ae,public X-Google-ArrivalTime: 2001-08-20 09:52:29 PST From: helgi@NOSPAMdecode.is (Helgi Briem) Newsgroups: comp.lang.perl.misc,alt.ascii-art Subject: Re: This is not a question ... call me slow if you like... Date: Mon, 20 Aug 2001 16:39:40 GMT Reply-To: helgi@NOSPAMdecode.is Message-ID: <3b813aab.2448013607@news.isholf.is> References: <997446825.1634.0.nnrp-13.d4f094e4@news.demon.co.uk> <9l19mr$9ug$1@mamenchi.zrz.TU-Berlin.DE> <3B7B7E29.E1423382@earthlink.net> <998164032.16642@itz.pp.sci.fi> <6uvgjlroil.fsf@chonsp.franklin.ch> <9lqtjq$mnd$1@kujawiak.man.lodz.pl> X-Newsreader: Forte Free Agent 1.21/32.243 NNTP-Posting-Host: 213.167.128.100 X-Trace: 20 Aug 2001 16:39:40 -0800, 213.167.128.100 Lines: 35 Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed1.cidera.com!Cidera!portc01.blue.aol.com!news.stealth.net!proxad.net!199.202.55.10.MISMATCH!nntp1.aeq.teleglobe.net!teleglobe.net!news.isholf.is!213.167.128.100 Xref: archiver1.google.com comp.lang.perl.misc:65246 alt.ascii-art:7032 On 20 Aug 2001 11:51:22 GMT, Przemyslaw Brojewski wrote: >I get: >Modification of a read-only value attempted at cosik line 2. > >perl 5.6.1. > >what gives? OK, you're slow. Apparently you tried to modify a read-only value (a value that cannot be written to) in line 2 of cosik (whatever that happens to be). Apparently, perl 5.6.1 regards this as a Bad Thing. >From perldoc perldiag Modification of a read-only value attempted (F) You tried, directly or indirectly, to change the value of a constant. You didn't, of course, try 2 = 1, since the compiler catches that. But an easy way to do the same thing is: sub mod { $_[0] = 1 } mod(2); Another way is to assign to a substr that's off the end of the string. Regards, Helgi Briem