Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 527 forks source link

Problem Release 5.8.7 #7974

Closed p5pRT closed 18 years ago

p5pRT commented 18 years ago

Migrated from rt.perl.org#36306 (status was 'resolved')

Searchable as RT36306$

p5pRT commented 18 years ago

From P.G.Oosterholt@delagelanden.com

Hi

I have a problem with the new Perl release which I did not have with the 5.6.1 release.

With this mail I will send a perl script and input file. If I run this against the 5.8.7 release I get the error

Start Verwerking... Modification of a read-only value attempted at ./lgp2000.pl line 85\, \ line 14.

The 5.6.1. release runs fine.

In line 14 there is a '% n' if we change the '% 'into 'percent' or the 'n' into 'ernaar' then it is ok.

14 58000013596900529Kendrion heeft in het eerste kwartaal van 2005 een nett owinst behaald van 3\,6 mln euro. De omzet liep op van 133\,7 mln euro naar 146\,2 mln euro. Het bedrijfsresultaat daalde met 10% n ar 6\,9 mln euro. (FD10052005)

Are you able to advise me what to do to solve this? \<\<LGP2000.DAT>>
\<\<lgp2000.pl>>

With kind regards\,

Peter Oosterholt

De Lage Landen International B.V. IT Europe Division IT Utilities - Developer Tel +31-40-2339044 Fax +31-40-2338625 E-Mail​: Mailto​:P.G.Oosterholt@​delagelanden.com Web​: HTTP​://www.delagelanden.com

================================================ The information transmitted via this e-mail is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review\, retransmission\, dissemination or other use of\, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error\, please contact the sender and delete the material from any computer.

p5pRT commented 18 years ago

From P.G.Oosterholt@delagelanden.com

LGP2000.DAT

p5pRT commented 18 years ago

From P.G.Oosterholt@delagelanden.com

lgp2000.pl

p5pRT commented 18 years ago

From @nwc10

On Thu\, Jun 16\, 2005 at 07​:57​:05AM -0000\, P. G. Oosterholt @​ delagelanden. com wrote​:

Start Verwerking... Modification of a read-only value attempted at ./lgp2000.pl line 85\, \ line 14.

The 5.6.1. release runs fine.

In line 14 there is a '% n' if we change the '% 'into 'percent' or the 'n' into 'ernaar' then it is ok.

I think that if you correct this line of your script from

  printf $filFileHandle $strInput;

to

  print $filFileHandle $strInput;

you script will work. The author of the script fell into the trap mentioned in the documentation for printf​:

  Don't fall into the trap of using a printf when a simple   print would do. The print is more efficient and less   error prone.

However\, it looks like the error reporting for printf with a %n format and no argument could be more helpful. The value it's trying to modify doesn't exist\, rather than merely being read-only​:

$ perl -we 'printf "%n"' Modification of a read-only value attempted at -e line 1.

Nicholas Clark

p5pRT commented 18 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 18 years ago

From P.G.Oosterholt@delagelanden.com

Nicholas

Thanks for the quick response. It works fine now. So you can close the call I think.

With kind regards\,

Peter Oosterholt

De Lage Landen International B.V. IT Europe Division IT Utilities - Developer Tel +31-40-2339044 Fax +31-40-2338625 E-Mail​: Mailto​:P.G.Oosterholt@​delagelanden.com Web​: HTTP​://www.delagelanden.com

-----Original Message----- From​: Nicholas Clark via RT [mailto​:perlbug-followup@​perl.org] Sent​: 16 juni 2005 11​:34 To​: Oosterholt\, PG (Peter) Subject​: Re​: [perl #36306] Problem Release 5.8.7

On Thu\, Jun 16\, 2005 at 07​:57​:05AM -0000\, P. G. Oosterholt @​ delagelanden. com wrote​:

Start Verwerking... Modification of a read-only value attempted at ./lgp2000.pl line 85\, \ line 14.

The 5.6.1. release runs fine.

In line 14 there is a '% n' if we change the '% 'into 'percent' or the 'n' into 'ernaar' then it is ok.

I think that if you correct this line of your script from

  printf $filFileHandle $strInput;

to

  print $filFileHandle $strInput;

you script will work. The author of the script fell into the trap mentioned in the documentation for printf​:

  Don't fall into the trap of using a printf when a simple   print would do. The print is more efficient and less   error prone.

However\, it looks like the error reporting for printf with a %n format and no argument could be more helpful. The value it's trying to modify doesn't exist\, rather than merely being read-only​:

$ perl -we 'printf "%n"' Modification of a read-only value attempted at -e line 1.

Nicholas Clark

================================================ The information transmitted via this e-mail is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review\, retransmission\, dissemination or other use of\, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error\, please contact the sender and delete the material from any computer.

p5pRT commented 18 years ago

@tux - Status changed from 'open' to 'resolved'