shriken has asked for the wisdom of the Perl Monks concerning the following question:
I have read over Common Causes for "Modification of a read-only value attempted" but am (obviously) still not seeing my mistake. I have some dusty Perl code that was being run with 5.8.8, and today I tried running it under 5.10.1. Execution stopped early on with:
Modification of a read-only value attempted at /usr/local/emonitor/perl_libs/emonitor.pm line 190.That module has (among other things)...
package emonitor; require Exporter; # snip for post brevity use strict; # more snipping of various other modules being use'd our @ISA = qw(Exporter); our @EXPORT = qw(); our @EXPORT_OK = qw( # still more snipping of other methods etc sub list_hosts { my($cfg, $hosts_r, $ow) = @_; bless($cfg, 'configthing'); ## <-- this is line 190
In the main file, the emonitor modules is use'd as use emonitor qw() and the call to the method happens like this (again, with liberal snippage):
use strict; use warnings; use configthing qw(); our configthing $cfg = new configthing; emonitor::list_hosts($cfg, \@hosts);
|
|---|